-
-
Save squarism/6112dcf45e49692f3cbc to your computer and use it in GitHub Desktop.
Redefine true and false in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clever trick from @tlehman.