At 07:36 PM 5/12/2005 -0500, Ka-Ping Yee wrote: >On Thu, 12 May 2005, Brett C. wrote: > > Guido van Rossum wrote: > > > Try to come up with a precise specification and we'll talk. > > > > If a new exception is raised (e.g., not a bare 'raise') while a current > > exception is active (e.g., sys.exc_info() would return something other > > than a tuple of None), then the new exception is made the active exception > > and the now old exception is assigned to the new exception's context > > attribute to be the old exception. > >Yeah, i think that's basically all there is to it. I'll go have a peek >at the interpreter to see if i'm forgetting something.
I think the main problem is going to be that (IIUC), Python doesn't "know" when you've exited an 'except:' clause and are therefore no longer handling the exception. sys.exc_info() still gives you the exception you just caught. I think that a lot of the questions Guido brought up are directly related to this. Also, what about code like this: try: doSomething() except SomeError: pass doSomethingElse() Should exceptions raised by doSomethingElse()' be treated as having the SomeError as their context, if it was raised? If I understand correctly, the interpreter cannot currently distinguish between this, and the case where an error is raised inside the 'except' clause. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com