[Python-3000] exception info [was: Discussions with no PEPs]

Thomas Wouters thomas at python.org
Tue Mar 13 18:42:33 CET 2007


On 3/13/07, Guido van Rossum <guido at python.org> wrote:
>
> >
> > Would this apply to Python code as well? I.e. if you use
> > a raise statement with a class, it doesn't get instantiated
> > immediately? And if you catch it with an except clause which
> > doesn't capture the exception, it's never instantiated?
> > That would be a bonus.
>
> I *think* that's how it works now, and I don't intend to break this.


Eh, I don't see how it can, when you do 'raise ExceptionClass(args)' (like
you want everyone to use :). It certainly doesn't, now; the arguments to
'raise' are just expressions, there is no specialcasing of calling anything.
I don't believe it does so with the two-argument raise either -- at least,
when experimenting, the body of an exception class's __init__ method is
executed before the body of a 'finally' suite.

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20070313/e150e424/attachment.htm 


More information about the Python-3000 mailing list