For the record, I still really don't like PEP 463. We should strive to catch fewer exceptions, not make it easier to catch them.
On Mon, Sep 12, 2016 at 7:09 AM, Chris Angelico <[email protected]> wrote: > On Tue, Sep 13, 2016 at 12:03 AM, Rob Cliffe <[email protected]> > wrote: >> Assuming you can't break existing code that already traps TypeError, >> AttributeError, etc., I don't see how you can do this without >> having separated kinds of NoneError which were subclasses of TypeError, >> AttributeError, etc. > > class NoneError(Exception): pass > class TypeNoneError(TypeError, NoneError): pass > class AttributeNoneError(AttributeError, NoneError): pass > > Now you can catch NoneError to catch None.xyz, or AttributeError to > catch foo.xyz for any foo. > > I don't think it's good, but it's possible. > > ChrisA > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
