[Python-Dev] Simple generators, round 2

Neil Schemenauer nas@python.ca
Mon, 26 Mar 2001 20:43:33 -0800


Tim Peters wrote:
> My belief is that generators don't become *truly* pleasant
> unless "yield" ("suspend"; whatever) is made a new statement
> type.

That's fine but how do you create a generator?  I suspose that
using a "yield" statement within a function could make it into a
generator.   Then, calling it would create an instance of a
generator.  Seems a bit too magical to me.

  Neil