On 07.07.2018 2:31, Guido van Rossum wrote:
Since Guido, the first respondent, did not immediately shoot
down, I intend to flesh it out and make it more concrete.
https://en.wikipedia.org/wiki/List_comprehension#History, the term's
known from at least 1977 and comes from such influential languages
as NPL, Miranda and Haskell. So it's not you to blame for it :-)
Also, "generator builder" is not much more expressive
than "generator expression",
"generator builder" is simply incorrect. The GE doesn't "build"
generators, it's a generator itself. It's a generator _and_ an
expression. What could be a more obvious name?
This suggestion looks like coming from someone who hasn't quite
grasped generators yet.
and the key observation that led to this idea was that
it's such a mouthful to say "comprehensions and generator
Since "X comprehensions" are advertised as and intended to be
functionally equivalent to `X(generator expression)', I use just
"generator expressions" to refer to all.
That's accurate because the common part with the distinctive syntax
-- which is the thing referred to when addressing them all --
effectively _is_ a generator expression (the syntax differences in
the leading term are insignificant), what wraps it is of no concern.
So, no new terms are necessary, but someone who cares may add a note
to the docs to this effect.
Maybe it's not too late to start calling the latter
"generator comprehensions" so that maybe by the year 2025 we
can say "comprehensions" and everyone will understand we
mean all four types?
FWIW more people should start using "list display" etc.
for things like [a, b, c].
Python-Dev mailing list