<div dir="ltr"><div class="gmail_quote"><div dir="ltr">[Chris Barker]</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote>> However, generator expressions ( why don’t we call them generator<br><blockquote class="gmail_quote" style="margin:0px 0.8ex;border-left:1px solid rgb(204,204,204);border-right:1px solid rgb(204,204,204);padding-left:1ex;padding-right:1ex"></blockquote>> comprehensions?)<br><br>Because nobody really liked the "iterator comprehensions" or "accumulator displays" they were variously called at the start.<span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></span>
<pre style="color:rgb(0,0,0);text-decoration-style:initial;text-decoration-color:initial"> <a href="https://mail.python.org/pipermail/python-dev/2003-October/039186.html">https://mail.python.org/pipermail/python-dev/2003-October/039186.html</a><br></pre>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.<br><br>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.<br>
<br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">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 :-)<br><br></span></div></div>