PEP 255: Simple Generators

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Jun 20 10:58:48 EDT 2001


19 Jun 2001 23:55:26 +0200, Denys Duchier <Denys.Duchier at ps.uni-sb.de> pisze:

> The one thing that rubs me the wrong way with this proposal is that it
> is not compositional.  Unless I misread the PEP, the entire generation
> logic must be defined in a single function (because the `yield'
> keyword must statically occur within the body of the generator
> function).  This makes it impossible to use higher-order programming
> to assemble complex generators from smaller blocks.

Isn't
    for x in g(): yield x
a way to compose generators? What more do you want?

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list