Showing content from http://mail.python.org/pipermail/python-dev/attachments/20180709/ba69f357/attachment.html below:
<div dir="ltr"><div>Definitely docs first. And we should keep references to generator expressions too, if only to explain that they've been renamed.</div><div><br></div><div>Perhaps someone should try it out in a 3rd party tutorial to see how it goes? I'm CC'ing Raymond Hettinger.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 9, 2018 at 12:57 PM Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, 9 Jul 2018 at 12:05 Guido van Rossum <<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think this is worth a try.<br></div></blockquote><div><br></div><div>How far do we want to go with this? Update the docs? Update the grammar and/or code? I think the former is probably good enough for now to see if it takes, and if it does then we can talk about updating code to not confuse people.<br></div><div>Â </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"></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" target="_blank">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="m_-1445379674089529817m_-6897539933664492192gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</blockquote></div></div>
</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>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4