Destructors and exceptions

David Turner dkturner at telkomsa.net
Wed Jun 9 10:16:23 EDT 2004


> > 
> > Then why not unreference the traceback (and therefore destroy it and
> > the down-stack locals, if the exception handler hasn't made another
> > reference) at the end of the handling suite?
> 
> Fine, except that isn't what Python does now, and the current behaviour 
> needs to be kept for compatibility. So if that is the behaviour you want, 
> you have to do that explicitly yourself at the end of every exception 
> handler.

Are you sure the current behaviour needs to be kept?  Isn't
referencing the traceback outside of an exception handler a little
dodgy in the first place?  I'm sorry if I sound argumentative, but I
do want to understand the issues thoroughly :-).

Regards
David Turner



More information about the Python-list mailing list