Generators versus Coroutines

Paul Rubin http
Tue Aug 17 06:29:08 CEST 2004


Nick Patavalis <npat at efault.net> writes:
> But this is only a tiny portion of what one can do with generators and
> coroutines! Actually for me it is the least interesting part. Having a
> keyword that suggests the possibility of resumable functions
> (resumable threads of execution), but then impose such limitations, is
> frustrating.

The limitations aren't as bad as they sound.  There are easy
workarounds most of the time.  I do think using the yield keyword
to identify generator functions was unfortunate, since it makes
it harder to get rid of the limitations.



More information about the Python-list mailing list