Skip to content

Instantly share code, notes, and snippets.

@squarism
Forked from tlehman/boolfail.py
Last active September 21, 2015 23:15
Show Gist options
  • Save squarism/6112dcf45e49692f3cbc to your computer and use it in GitHub Desktop.
Save squarism/6112dcf45e49692f3cbc to your computer and use it in GitHub Desktop.
Redefine true and false in python
# Python boolean fail
# Or how to redefine True and False and win any argument on the internet!
# Love, @tlehman
from unittest import TestCase
class BoolFail(TestCase):
def test_false(self):
True = False
assert True == False
def test_not_true(self):
truetrue = not(not(1==1))
True = False
assert True != truetrue
@squarism
Copy link
Author

Clever trick from @tlehman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment