[Chris Barker]

> > However, generator expressions ( why don’t we call them generator

> > comprehensions?)

Because nobody really liked the "iterator comprehensions" or "accumulator
displays" they were variously called at the start.

    https://mail.python.org/pipermail/python-dev/2003-October/039186.html

As that explains, "generator expressions" was an attempt to break away from
that "comprehensions" was always a dubious term, carried over from set
theory where the term focuses on the optional "if" part rather than the
more fundamental iterator or computation parts.

At the start, for some (forgotten by me) reason it seemed important to make
a distinction between "things like this" that were evaluated at once (list,
dict, and set comprehensions) and the new-fangled accumulator displays that
got evaluated lazily.  But the "generator" in "generator comprehensions"
would really be enough all by itself to make that clear enough.

So if we had it to do over again I'd sigh and accept "generator
comprehensions" anyway.  It's been an eternal PITA - and especially in the
PEP 572 threads! - to keep typing "comprehensions or generator
expressions".  Then again, if I had the power of Guido's time machine, I'd
go back more, and not use "comprehensions" for anything to begin with.
Instead we'd have list, dict, set, and generator twizzlers, affectionately
called listwiz, dictwiz, setwiz, and gentwiz by the cool kids :-)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to