[Python-Dev] uthread strawman

Guido van Rossum guido@python.org
Thu, 09 Nov 2000 10:30:03 -0500

> I imagined something like
> try:
> 	raise RestartableException, continuation.current_continuation()
> except RestartableException, ex:
> 	# correct the problem
> 	ex.saved_continuation()
> IOW, just put the continuation in the exception object.
> I don't think you can use generators/coroutines to simulate something
> like this

You can make the exception handler into a separate coroutine -- then
no reusable continuations are needed.  The coroutine can repair the
exception and resume the other.

--Guido van Rossum (home page: http://www.python.org/~guido/)