[Python-3000] self-contained exceptions
Josiah Carlson
jcarlson at uci.edu
Wed Jan 10 17:36:01 CET 2007
"Guido van Rossum" <guido at python.org> wrote:
>
> 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.)
I suppose when compared with the 'with' syntax, which is also supposed
to handle error conditions and cleanup, I am convinced that propagating
the name post-context/exception management should be avoided. Consider
the alternate semantics withdrawn (if it wasn't considered rejected ;) ).
- Josiah
More information about the Python-3000
mailing list