Skip to content

Instantly share code, notes, and snippets.

@superbobry
Last active January 20, 2018 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superbobry/93c056b4f29c6a999d0b869e5e42c72e to your computer and use it in GitHub Desktop.
Save superbobry/93c056b4f29c6a999d0b869e5e42c72e to your computer and use it in GitHub Desktop.
>>> 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