Last active
January 20, 2018 20:04
-
-
Save superbobry/93c056b4f29c6a999d0b869e5e42c72e to your computer and use it in GitHub Desktop.
try-except and abc https://bugs.python.org/issue12029
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
>>> Error(abc.ABC, Exception): pass | |
... | |
>>> EndOfTheWorld(Exception): pass | |
... | |
>>> Error.register(EndOfTheWorld) | |
<class '__main__.EndOfTheWorld'> | |
>>> e = EndOfTheWorld() | |
>>> isintance(e, Error) | |
True | |
>>> try: | |
... raise e | |
... except Error: | |
... pass | |
... | |
Traceback (most recent call last): | |
File "<stdin>", line 2, in <module> | |
__main__.EndOfTheWorld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment