[Python-Dev] yield back-and-forth?
Phillip J. Eby
pje at telecommunity.com
Fri Jan 20 22:39:13 CET 2006
At 11:19 AM 01/20/2006 -0800, Guido van Rossum wrote:
>(There *are*other uses besides the trampoline,
>right? :-)
It's easy to come up with use cases where you feed data *into* a generator
(parsers and pipelines, for example). I just don't know of any
"simultaneous bidirectional" uses other than in association with a
coroutine scheduler, or a dedicated pipelining tool. In both the coroutine
and pipelining cases, generator composition is an easy job for whatever
coroutine or pipelining library is in use; it just happens external to the
generator, perhaps by yielding a special value.
More information about the Python-Dev
mailing list