[Python-ideas] Idea

Paul Moore p.f.moore at gmail.com
Thu Aug 21 21:38:07 CEST 2014


On 21 August 2014 20:23, Scott Blair <scottyblair at gmail.com> wrote:
> Add continue to a try, except statement to continue where the code threw an
> error. Or a function of exceptions to get the line number at which it was
> thrown along with a way to go back to that line.

I'm pretty sure this has been suggested before. The big problem is
that an exception can exit many levels of function invocation before
being caught. Restarting function call frames that have been exited is
a non-trivial exercise in general, and for all practical purposes not
possible in CPython. If you're interested in details, Stackless Python
does something similar, and for a more theoretical discussion you can
start at http://en.wikipedia.org/wiki/Continuation

Paul


More information about the Python-ideas mailing list