Created
October 25, 2015 04:50
-
-
Save ssanderson/e231b829cbaf20bb5045 to your computer and use it in GitHub Desktop.
assert statements dynamically look up the value of AssertionError in the current context
This file contains 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
>>> AssertionError = ValueError | |
>>> assert False, "Assert Failed!" | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
ValueError: Assert Failed! | |
>>> AssertionError = None | |
>>> assert False, "Assert Failed!" | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: 'NoneType' object is not callable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment