Jeroen Demeyer wrote:
> On 2019-07-02 23:29, Brett Cannon wrote:
> > But two, this would be a semantic shift of what
> > classes directly inherit from BaseException.
> > It depends how you interpret that. I always interpreted classes 
> inheriting directly from BaseException as exceptions that you almost 
> never want to catch in an "except Exception" block.

As co-author of PEP 352 I can tell you the intent is the one I laid out. ;) 
(See https://www.python.org/dev/peps/pep-0352/#exception-hierarchy-changes.)

> > Adding SystemError to that list would
> > make it a unique error condition that doesn't inherit from Exception.
> > I would argue that the various exception classes inheriting from 
> BaseException are already quite unique: a KeyboardInterrupt is very 
> different from a GeneratorExit for example.

Depends on your view. To me they are both control flow; one is for generators, 
one is for whole applications, but the point of both is to bubble up a control 
flow shift as appropriate and not be caught by `except Exception` blocks.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EQHW2CKD4WDKZWQBB3BFFYJP2N2TYSXB/

Reply via email to