Exception feature creep! (was: re-entering in the normal flow after an exception is raised)

Michele Simionato michele.simionato at gmail.com
Sat Oct 2 05:05:23 CEST 2004

finite.automaton at gmail.com (Lonnie Princehouse) wrote in message news:<4b39d922.0410011152.31fb1dae at posting.google.com>...
> In a recent post, Michele Simionato asked about resumable (or
> re-entrant) exceptions, the basic idea being that when raised and
> uncaught, these exceptions would only propagate backwards through a
> limited number of frames before being implicitly ignored. 

Well, actually that is NOT what I asked. Erik Max Francis got my point:

The idea is that you can catch the exception and resume it, in
which case execution continues from the point that the resumable
exception was _raised_.  The exception, when caught, can still be
reraised (and another catcher resuming it will still cause it to resume
from the original point it was raised).  If the exception is not caught,
then it acts as a normal exception and halts the program with a stack

I have no idea about how difficult would be to implement resumable exceptions
in Python; also I am not sure about their cost vs. benefit. For sure, in
2.5 years of Python programming this is first time I have got an use case
for resumable exceptions; still it is a contrived case. So, I am not in
dire need of resumable exceptions.
Nevertheless, it is possible that if we had resumable exceptions we 
could use them as a control flow structure in non-exceptional situations.
One could speculate about the idea ...

                   Michele Simionato

More information about the Python-list mailing list