[Python-Dev] with_traceback

Michael Foord fuzzyman at voidspace.org.uk
Thu Mar 1 07:08:26 CET 2007


Andrew Dalke wrote:
> On 2/28/07, James Y Knight <foom at fuhm.net> wrote:
>   
>> It seems to me that a stack trace should always be attached to an
>> exception object at creation time of the exception, and never at any
>> other time. 
Sounds good in principle - but don't forget that normally the exception 
will be instantiated and *then* passed to the raise statement.

I've never seen a module level exception instance before. With the 
proposed changes, modules that do this would *continue* to work, surely 
? So they lose nothing (compared to the current situation) by having the 
traceback information overwritten, they just can't take direct advantage 
of the new attribute.

Michael Foord


More information about the Python-Dev mailing list