<div dir="ltr">I think this is worth a try.<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 9, 2018 at 12:04 PM Chris Barker - NOAA Federal <<a href="mailto:chris.barker@noaa.gov">chris.barker@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">TL;DR-<br>
<br>
+1 on advocating the term â€œgenerator comprehension” as a synonym for<br>
“generator expression” in future documentation and instructional<br>
materials.<br>
<br>
The long version:<br>
<br>
If we were starting from scratch, maybe it would makes sense to use â€œ<br>
builder” or something else, rather than comprehension. But we’re  not<br>
starting from scratch.<br>
<br>
And â€œlist comprehension” has become a pretty universal (or at least<br>
common) term in the python world. So we really can’t expect to re-name<br>
that.<br>
<br>
And despite the term having its roots in an esoteric corner of<br>
mathematics, I’ve never seen anyone confused by it â€” it’s just a new<br>
word for a new thing to most folks.<br>
<br>
Which is actually why â€œgenerator expression” is a bit confusing â€” it<br>
seems to have more in common with comprehensions than with generators<br>
<br>
(As in: the things functions with a yield in them produce)<br>
<br>
In fact, the term â€œgenerator” is a bit confusing itself â€” due to it<br>
being a common English word, it seems to refer to the generic idea of<br>
“a thing that generates values on the fly”, which, of course it can be<br>
in Python. But it actually is a specific type. And you can make a<br>
“thing that generates values in the fly” with a regular class that<br>
follows the iterator protocol.<br>
<br>
So re-using the word in â€œgenerator expression” just adds a bit to the<br>
confusion. (Even though it’s technically correct, it does â€œmake” an<br>
actual generator object, doesn’t it? (On a phone, so I can’t check)<br>
but that’s kind of an implementation detail.<br>
<br>
Also: if you google: â€œpython list comprehension” you get a LOT of hits<br>
to tutorials, etc.<br>
<br>
So it is WAY too late to change that name.<br>
<br>
When you google â€œpython generator expression” the top hit is the<br>
python docs, and the next few are about comparing generator<br>
expressions and list comprehensions.<br>
<br>
So I think we could start a new naming scheme for those.<br>
<br>
 ‘cause then we’d get lost of questions about the difference between<br>
generator expressions and generator comprehensions ;-)<br>
<br>
<br>
-CHB<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)</div>