A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053685.html below:

[Python-Dev] Chained Exceptions

[Python-Dev] Chained Exceptions [Python-Dev] Chained ExceptionsGuido van Rossum gvanrossum at gmail.com
Fri May 13 03:27:33 CEST 2005
[Phillip J. Eby]
> 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.

But the compiler knows and could insert code to maintain this state.

> 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.

Right.

> 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.

Indeed the interpreter currently doesn't distinguish between these,
but I think it ought to for the  purposes of this proposal.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4