Generators versus Coroutines

Nick Patavalis npat at efault.net
Tue Aug 17 00:16:44 EDT 2004


On 2004-08-16, Lenard Lindstrom <len-1 at telus.net> wrote:
>
> That is the idea. Generators are a shorthand way to implement iterators.
> But relative to other methods they are fast.
>

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. Furthermore it can be really problematic if the language
is to be extented to support the more generic version, since then you
will have two syntaxes for the same thing, or you will have to
introduce incompatibilities.

/npat



More information about the Python-list mailing list