<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">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">ncoghlan@gmail.com</a>>]<br>
> ...<br>
<span class="gmail-">> 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><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">https://wiki.python.org/moin/BitwiseOperators</a><br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>