News for hackers. Stuff that matters.
Re:Co-routines as an alternative to state machines by cturner on Sunday August 30, 2009 @04:46AM (#794258)
Yielding from within called functions is the basic generator syntax, but I think I know what you're talking about.

> Maybe Python 3 fixed this

Can you verify that this is what is being talked about at page 26 of this link? http://www.dabeaz.com/coroutines/Coroutines.pdf

If so - Python 2.5.

Re:Co-routines as an alternative to state machines by silentbicycle on Sunday August 30, 2009 @08:06AM (#794394)
Not slide or page 26, no.

From PEP 342:

    Also, generators cannot yield control while other functions are
    executing, unless those functions are themselves expressed as
    generators, and the outer generator is written to yield in response
    to values yielded by the inner generator.  This complicates the
    implementation of even relatively simple use cases like asynchronous
    communications, because calling any functions either requires the
    generator to "block" (i.e. be unable to yield control), or else a
    lot of boilerplate looping code must be added around every needed
    function call.
It looks like 2.5 fixed that particular issue. (I'm not holding my breath on tail-call optimization, though...)