<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#330033" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 7/6/2018 11:20 AM, Brett Cannon
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAP1=2W7Y2-dPa9MY5LUPm-jxmyPPNEK0Gv+SGTvGHdGzZyZ9Jw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr"><br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, 6 Jul 2018 at 08:52 Chris Barker - NOAA
Federal via Python-Dev <<a
href="mailto:python-dev@python.org" moz-do-not-send="true">python-dev@python.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Are we
just having fun here?<br>
<br>
Or might we actually start using a new naming convention for<br>
the-syntax-formerly-known-as-generator-expressions?<br>
</blockquote>
<div><br>
</div>
<div>If you can create a groundswell of support then maybe.</div>
</div>
</div>
</blockquote>
<br>
"Comprehension" was an incomprehensible term to me, when I first
heard it. After reading the documentation, I comprehended it, but
the term is meaningless.<br>
<br>
"generator expression" is actually a little more comprehensible, by
analogy to a power (electricity) generator... values are generated.
But comprehensions would have been more intuitively understood by
me, had they been called "list generators" or "dict generators" or
"set generators".<br>
<br>
The difference between comprehensions and generators seems to be one
of timing and sequencing: the comprehensions are comprehended as
fast as possible, while generators are lazy (unlike those
electricity generators, unless you turn them on and off repeatedly).
So neither term is very intuitive to "plain old programmers" unless
perhaps they happen to know some of the advanced math concepts where
the term "comprehension" is claimed to come from (obviously, in
spite of a math degree from some years back, I never encountered
that term).<br>
<br>
Focusing just on lists, at this time, "list builder" would be better
than "list generator" because using "generator" to replace
"comprehension" would be confusing because of the history of the
terminology as used/documented currently.<br>
<br>
A generator seems to be a "lazy list builder".<br>
<br>
If the names are changed, for a time both terminologies would have
to coexist, so it would be critical to use terms not already in use
in Python terminology. I would find it an improvement to use terms
like "list builder" rather than "comprehension".<br>
<br>
<blockquote type="cite"
cite="mid:CAP1=2W7Y2-dPa9MY5LUPm-jxmyPPNEK0Gv+SGTvGHdGzZyZ9Jw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<div>-Brett<br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-CHB<br>
<br>
Sent from my iPhone<br>
<br>
> On Jul 3, 2018, at 11:54 PM, Greg Ewing <<a
href="mailto:greg.ewing@canterbury.ac.nz" target="_blank"
moz-do-not-send="true">greg.ewing@canterbury.ac.nz</a>>
wrote:<br>
><br>
> Steven D'Aprano wrote:<br>
>> - list builder syntax is syntax which returns a
list;<br>
>> - dict builder syntax is syntax which returns a
dict;<br>
>> - set builder syntax is syntax which returns a set;<br>
>> - generator builder syntax is syntax which returns
a generator.<br>
><br>
> You only get a list/dict/set from the first three after<br>
> you've run the iterators within it, but with a
generator<br>
> expression, you already have a generator before you've<br>
> run it. That makes it feel different to me.<br>
><br>
> --<br>
> Greg<br>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>