At 12:18 AM 1/5/2007 +0100, Malte Helmert wrote: >Phillip J. Eby wrote: > > 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. :) > >What should happen in the last line here? > >def f(): > e = "spam" > try: > 1 / 0 > except Exception, e: > print e > print e
It should fail with an UnboundLocalError; anything else (IMO) would encourage "overly clever" code that's hard for a reader to decipher. _______________________________________________ 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
