[Python-Dev] Tidier Exceptions

Guido van Rossum gvanrossum at gmail.com
Fri May 13 02:46:26 CEST 2005


[Brett C.]
> Seems like, especially if we require inheritance from a base exception class in
> Python 3000, exceptions should have standard 'arg' and 'traceback' attributes
> with a possible 'context' attribute (or always a 'context' attribute set to
> None if not a chained exception).
> 
> I don't think there is other data normally associated with exceptions is there?

I despise the "arg" argument -- I like Java's "message" concept better.

> I really need to get off my ass one of these days and just write a PEP targeted
> for Python 3000 with base inheritance, standard attributes (including exception
> chains), reworking the built-in exception inheritance hierarchy, and whether
> bare 'except' statements should go or only catch certain exceptions.  Could
> probably stand to break it up until multiple PEPs, though.  =)

+1.

I think these things are sufficiently closely related to keep them all
in one PEP.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list