Most "active" coroutine library project?

Grant Edwards invalid at invalid.invalid
Fri Sep 25 12:55:09 EDT 2009


On 2009-09-25, Simon Forman <sajmikins at gmail.com> wrote:
> On Fri, Sep 25, 2009 at 11:42 AM, Grant Edwards <invalid at invalid.invalid> wrote:

>> You can't call a function that yields control back to the other
>> coroutine(s). ?By jumping through some hoops you can get the
>> same effect, but it's not very intuitive and it sort of "feels
>> wrong" that the main routine has to know ahead of time when
>> calling a function whether that function might need to yield or
>> not.
>
> You mean a "trampoline" function?  I.e. you have to call into your
> coroutines in a special main function that expects as part of the
> yielded value(s) the next coroutine to pass control to, and your
> coroutines all need to yield the next coroutine?

Exactly.  Compared to "real" coroutines where a yield statement
can occur anywhere, the trampoline business seems pretty
convoluted.

-- 
Grant Edwards                   grante             Yow! Do you think the
                                  at               "Monkees" should get gas on
                               visi.com            odd or even days?



More information about the Python-list mailing list