[Python-Dev] Tidier Exceptions

Brett C. bac at OCF.Berkeley.EDU
Fri May 13 22:34:36 CEST 2005


Guido van Rossum wrote:
> [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.
> 

Works for me.

> 
>>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.
> 

OK, I will see if I can get to the PEP this summer assuming I have time
(waiting on official offer on an internship that will keep me busy this summer,
but I am hoping to spend my free time Python hacking; got to finish the AST
branch some day  =).  Probably will also write it up in parts as outlined above
so that I can just get parts out quickly without being held up by discussions
about other sections.

-Brett


More information about the Python-Dev mailing list