<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 2, 2018 at 11:42 PM, Tim Peters <span dir="ltr"><<a href="mailto:tim.peters@gmail.com" target="_blank">tim.peters@gmail.com</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">"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></div></div></div></blockquote><div><br></div><div>I always wondered about that :-) -- I'd say for most of us that aren't familiar with set theory, it's kind of a "sounds something like putting thing together" word and I just left it at that, and learned what they are.</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 class="gmail_quote"><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". </span></div></div></blockquote><div><br></div><div>Well, too late to change the official name, but not too late to start using the term in threads like these -- and other documentation, etc....</div><div><br></div><div>I find there is a lot of confusion about the word "generator", as it implies a "thing that generates values on the fly" (like, say the range() object.</div><div><br></div><div>But then, in Python, a generator is something that gets crated by a generator function, and CAN be an "thing (iterator) that generates things on the fly", but can also be a more generic coroutine, and can be used in nifty ways that really have nothing to do with generating a bunch of value. (like pytest fixtures, for example)</div><div><br></div><div>So we have generators, iterators, and iterables, and generators can be iterators, but aren't always, and any number of iterators can generate values on the fly, and ....</div><div><br></div><div>so it's all a bit of a mess to explain to a newbie.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">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></span></div></div></blockquote><div><br></div><div>I'd like that!</div><div><br></div><div>-CHB</div><div> </div></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R (206) 526-6959 voice<br>7600 Sand Point Way NE (206) 526-6329 fax<br>Seattle, WA 98115 (206) 526-6317 main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>