[ANN] PEP 279 version 1.6

Raymond Hettinger python@rcn.com
Mon, 11 Mar 2002 13:42:58 -0500

PEP 279 -- Enhanced Generators has been updated:

Comments are invited on the revised PEP.

The changes were driven by comments from GvR,
from the authors of PEP 255, and from members of
the Py-Dev maillist.

The principal changes from the previous version are:

1.  Rationale section focused on generator usage instead
of lazy evaluation.

2.  The proposal for four builtins has been reduced to one.
Xzip, xfilter, and xmap are retracted.  Expanded the discussion
of the remaining proposed builtin, indexed().

3.  All sections expanded to include comments received
from GvR and the PEP 255 authors (the experts on the
existing generator implementation).

4.  Proposal for generator exception passing moved up
one section.

5.  Proposal for generator parameter passing listed as
deferred -- everyone thinks this may be a viable idea
but it doesn't have a chance in the near-term.

6.  The restartability discussion has been deleted -- Guido
thought it was evil.

Raymond Hettinger


Here are comments from Magnus Lie Hetland which were
received after the PEP was updated:

> I like indexed() a lot; +1. I'm quite happy to have it make PEP 281
> obsolete. Adding a separate module for iterator utilities seems like a
> good idea.
> Generator comprehensions seem mildly useful, but I vote +0. Defining a
> separate, named generator would probably be my preference. On the
> other hand, I do see the advantage of "scaling up" from list
> comprehensions.
> Even though I cannot speak for the ease of implementation, I vote +1
> for the exception passing mechanism.
> I like the generator parameter passing mechanism. Although I see no
> need to defer it, deferral seems to be the most likely scenario, and
> in the meantime I guess the functionality can be emulated either by
> implementing the generator as a method, or by passing a parameter with
> the exception passing mechanism.
> I guess there is no real need to comment on restartability, but I
> can't see that I have any need for it.