<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, May 4, 2018, 11:35 Guido van Rossum <<a href="mailto:guido@python.org">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"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 4, 2018 at 11:11 AM, Tim Peters <span dir="ltr"><<a href="mailto:tim.peters@gmail.com" target="_blank" rel="noreferrer">tim.peters@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank" rel="noreferrer">ncoghlan@gmail.com</a>>]<br>
> ...<br>
<span class="m_-390889375841535308gmail-">> Using a new keyword (rather than a symbol) would make the new construct<br>
> easier to identify and search for, but also comes with all the downsides of<br>
> introducing a new keyword.<br>
<br>
</span>That deserves more thought.  I started my paying career working on a<br>
Fortran compiler, a language which, by design, had no reserved words<br>
(although plenty of keywords).  The language itself (and<br>
vendor-specific extensions) never had to suffer "but adding a new<br>
keyword could break old code!" consequences.<br>
<br>
In practice that worked out very well,  Yes, you _could_ write<br>
hard-to-read code using language keywords as, e.g., identifier names<br>
too, but, no, absolutely nobody did that outside of "stupid Fortran<br>
tricks" posts on Usenet ;-)  It had the _intended_ effect in practice:<br>
 no breakage of old code just because the language grew new<br>
constructs.<br>
<br>
It's no longer the case that Python avoided that entirely, since<br>
"async def", "async for", and "async with" statements were added<br>
_without_ making "async" a new reserved word.  It may require pain in<br>
the parser, but it's often doable anyway.  At this stage in Python's<br>
life, adding new _reserved_ words "should be" an extremely high bar -<br>
but adding new non-reserved keywords (like "async") should be a much<br>
lower bar.<br></blockquote><div><br></div><div>Do note that this was a temporary solution. In 3.5 we introduced this hack. In 3.6, other uses of `async` and `await` became deprecated (though you'd have to use `python -Wall` to get a warning). In 3.7, it's a syntax error.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
That said, I expect it's easier in general to add a non-reserved<br>
keyword introducing a statement (like "async") than one buried inside<br>
expressions ("given").<br></blockquote></div><br></div><div class="gmail_extra">I'd also say that the difficulty of Googling for the meaning of ":=" shouldn't be exaggerated. Currently you can search for "python operators" and get tons of sites that list all operators.<br></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">Without adding hits to the search algorithm, this will remain the case.  Google must have clicks to rank up.  Right now there is no page, nothing on a high "Google juice" page like <a href="http://python.org">python.org</a>, no one searching for it, and no mass of people clicking on it.  no SO questions, etc.</span><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">there is a transient response for all change.  uniqueness and length of search term is just a faster one.  All python syntax is findable eventually due to popularity.  plus a better search is "why would I use...in python" or similar.</div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">= python also doesn't bring up anything interesting that wouldn't be had because of just "python".  The details are too mundane and/or technical and everyone knows already.</div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">that being said, if := had been (theoretically) included from the beginning, would people continue to have issues with it?  unlikely, but I can't know.  familiarity will cure many of these issues of readability or symbolic disagreement no matter what is chosen (well, to a point).  it's unfortunate that changes have to be made up front with so little information like that, so I'm not advocating anything based on this, just pointing it out.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">I do think post hoc assignment will cause a cognitive load, like trying to figure out which variable is the iterator, and having to keep two contexts till the end of a comp with one given statement.  </div><div dir="auto"><br></div><div dir="auto">[f(x) + a for all a in blah given x=1]  </div><div dir="auto"><br></div><div dir="auto">not worse than a double nested comp though.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">I also note that Google seems to be getting smarter about non-alphabetic searches -- I just searched for "python << operator" and the first hit was <a href="https://wiki.python.org/moin/BitwiseOperators" target="_blank" rel="noreferrer">https://wiki.python.org/moin/BitwiseOperators</a><br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="m_-390889375841535308gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank" rel="noreferrer">python.org/~guido</a>)</div>
</div></div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank" rel="noreferrer">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div></div></div>