On Mon, Nov 24, 2014 at 5:48 PM, Chris Angelico <firstname.lastname@example.org> wrote:
> As Guido said, "generator" is ambiguous; though I was
> inaccurate as well. A generator *object* is, as you show above, an
> iterator; a generator *function* is not actually iterable, but it is
> an iterator factory. An iterator class is also an iterator factory.
This is correct, and I don't think there is any ambiguity:
>>> def g(): yield 42
As explained in PEP 255, "a Python generator is a kind of Python iterator, but of an especially powerful kind." The other term introduced by PEP 255 is "generator function": "A function that contains a yield statement is called a generator function."
In my view, PEP 479 naturally follows from careful reading of PEP 225. All one needs to understand is the difference between a function that returns an iterator and its value.