At 01:41 AM 1/4/2007 -0600, Ka-Ping Yee wrote:
>How about this?
>
> except ExcType, e:
> try:
> # body
> finally:
> e = None
It's a little bit more difficult to explain in the reference manual. I was
figuring we'd say that the exception variable is bound only in the body of
the except clause; saying it becomes None when you exit sounds weirder to
me. How about:
except ExcType, e:
try:
# body
finally:
e = None
del e
Then we get the best of all three worlds: a clean explanation, a clean
implementation, and a pure source-to-source transformation.
Heck, you could even say the translation is:
except ExcType:
e = sys.exception # or whatever it's called in 3K
try:
# body
finally:
e = None
del e
Although I suppose you can't actually implement it that way. :)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com