[Python-ideas] except expression

Chris Angelico rosuav at gmail.com
Tue Feb 18 18:51:22 CET 2014


On Wed, Feb 19, 2014 at 4:45 AM, Andrew Barnert <abarnert at yahoo.com> wrote:
> If people do want to follow this, one thing to consider: we don't have to
> fiddle with the exception hierarchy; you can always override
> issubclass/isinstance by either using an
> ABC, or doing the same thing ABCMeta does. That would allow someone who
> wanted to catch some type of error that isn't usually considered an
> "expression error" but is commonly raised in expressions in their particular
> project to add that error.

Actually, I'm not sure that you can. Give it a try! The only thing you
can try to catch is a subclass of BaseException. But creating a tuple
would work.

ChrisA


More information about the Python-ideas mailing list