A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-June/045632.html below:

[Python-Dev] Re-raise in absence of an "active" exception

[Python-Dev] Re-raise in absence of an "active" exception"Martin v. Löwis" martin at v.loewis.de
Sat Jun 26 07:02:25 EDT 2004
Jeremy Hylton wrote:
> The definition of what it means for an exception to be "active" in a
> scope needs to be clarified.  The language reference doesn't appear to
> define what that means, so I took a narrow reading.  I think the code
> you mention later in your post is code I wrote :-).

It seems that Guido has attempted to clarify it as "an exception is 
active until the next exception is raised, or the program terminates".

However, that clarification doesn't describe the current implementation,
atleast not for interactive mode:

 >>> try:
...   1/0
... except:
...   pass
...
 >>> raise
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings 
(deprecated), not NoneType

Here, the re-raise doesn't find an exception anymore, even
though non has been raised...

I would prefer if it were clarified as "An exception is active
until the exception handler completes. When control runs off
the end of the exception handler, or it completes through a
return, break, or continue, no exception is active. When a new
exception is raised (or the currently active one is re-raised),
that exception becomes active."

Regards,
Martin


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