[Python-Dev] Re: [python-coro] coroutines and microthreads

Christian Tismer tismer@tismer.com
Fri, 17 Nov 2000 15:47:53 +0200


Just van Rossum wrote:
...
> >BTW, I've got an almost-working implementation of the coro API using
> >Stackless continuations!  Problem: I don't know how to raise an
> >exception for a continuation -- which I need to implement EarlyExit.
> >Can anyone help?
> 
> def hellraiser():
>     continuation.return_current()
>     raise <whatever>
> 
> k = hellraiser()
> k.caller = your_co
> k()
> 
> Just

Hey, there is it again, the little trick. I love it :-)

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer@tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com