[Python-3000] self-contained exceptions

Guido van Rossum guido at python.org
Wed Jan 10 16:47:40 CET 2007


On 1/9/07, Josiah Carlson <jcarlson at uci.edu> wrote:
> I know that one of the points of all of this is so that the name that
> the exc_info() stuff gets in the local scope doesn't propagate past the
> except clause, but I can't help feeling as if removing the name isn't a
> little overenthusiastic.

What's your use case, except for not breaking existing code?  Apart
from the latter, I can't think of a single use case that isn't served
just as well by *copying* the object reference into another variable.

BTW perhaps we should add the same semantics and syntax to 'with expr
as var'? I can't think of a reasonable use case for keeping var alive
after the with-statement terminates either. (Nor for using anything
more complex than a local variable, BTW.)

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


More information about the Python-3000 mailing list