<div dir="ltr">My preference is to do nothing.  If you end up making "where" a keyword in Python 3.8, numpy will probably:<br>* rename their where function to "where_" in 3.8<div>* add a where_ alias in Python < 3.8.</div><div><br></div><div>And then people will have to fix their code in 3.8 anyway.  Only instead of learning a new verbatim syntax, they will just add the familiar underscore.</div><div><br></div><div>One thing that should ideally be done is to improve the SyntaxError processing to special case use of keywords in places that identifiers are used.  Instead of:</div><div><br></div><div><div>In [1]: for if in range(10):</div><div>  File "<ipython-input-1-a51677fa6668>", line 1</div><div>    for if in range(10):</div><div>         ^</div><div>SyntaxError: invalid syntax</div></div><div><br></div><div>How about</div><div><br></div><div><div>In [1]: for if in range(10):</div><div>  File "<ipython-input-1-a51677fa6668>", line 1</div><div>    for if in range(10):</div><div>         ^</div><div>SyntaxError: "if" was used where a variable belongs, but "if" is a keyword.  Consider using "if_" instead.</div></div><div><br></div><div>Similarly,</div><div><br></div><div><div>In [2]: int.if</div><div>  File "<ipython-input-2-72291900e846>", line 1</div><div>    int.if</div><div>         ^</div><div>SyntaxError: "if" was used where an attribute name belongs.  Did you mean "if_"?</div></div><div><br></div><div>SyntaxError doesn't need to quickly generate its error strings.  So there is only an upside to having clear error messages.</div><div><br></div><div>On Thursday, May 17, 2018 at 1:54:42 PM UTC-4, Stephan Houben wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Fortunately we have Unicode bold characters nowadays<br><div><br>𝐢𝐟 if 𝐢𝐧 in:<br>    𝐫𝐞𝐭𝐮𝐫𝐧 return<br><div><br></div><div>Look ma! No syntactic ambiguity!<br><br></div><div></div></div></div></blockquote><div>That's hilarious :) </div><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div><div>Stephan<br></div><div><br><div class="gmail_quote">2018-05-17 19:10 GMT+02:00 Chris Barker via Python-ideas <span dir="ltr"><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vzW_UYHHCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">python...@python.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_quote"><span>On Wed, May 16, 2018 at 2:09 PM, Carl Smith <span dir="ltr"><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vzW_UYHHCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">carl....@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"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif;font-size:12.8px">If your position is that Guido shouldn't introduce keywords that are currently used as names at all,</span></div></div></blockquote><div><br></div></span><div>Exactly -- which is why I'm wondering my no one (that I've seen -- long thread)  is presenting the backwards option:</div><div><br></div><div>Any new keywords introduced will be non-legal as regular names.</div><div><br></div><div>\new_key_word</div><div><br></div><div>for instance.</div><div><br></div><div>Makes me think that it may have been good to have ALL keywords somehow non-legal as user-defined names -- maybe ugly syntax, but it would make a clear distinction.</div><div><br></div><div>how ugly would this be?</div><div><br></div><div><font face="monospace, monospace">\for i in range(n):</font></div><div><font face="monospace, monospace">    \while \True:</font></div><div><font face="monospace, monospace">        ...</font></div><div><br></div><div>pretty ugly :-(</div><div><br></div><div>But maybe not so much if only a handful of new ones....</div><div><br></div><div>Or is there another currently illegal character that could be used that would be less ugly?</div><div><br></div><div>I'm actually confused as to what the point is to the \ prefix idea for names:</div><div><br></div><div>* It would still require people to change their code when a new keyword was introduced</div><div><br></div><div>* It would be no easier / harder than adding a conventional legal character -- trailing underscore, or ???</div><div><br></div><div>* but now the changed code would no longer run on older versions of python.</div><div><br></div><div>I guess it comes down to why you'd want to call out:</div><div><br></div><div>"this is a name that is almost like a keyword"</div><div><br></div><div>Seems like a meh, meh, lose proposal to me.</div><div><br></div><div>OK, I see one advantage -- one could have code that already has BOTH word and word_ names in it. So when word becomes a keyword, a tool that automatically added an underscore would break the code. whereas if it automatically added an currently illegal character, it wouldn't shadow anything.</div><div><br></div><div>But a sufficiently smart tool could get around that, too.</div><div><br></div><div>-CHB<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br></div><div><br></div></font></span></div><span><font color="#888888">-- <br><div><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="javascript:" target="_blank" gdf-obfuscated-mailto="vzW_UYHHCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Chris....@noaa.gov</a></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vzW_UYHHCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Python...@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-ideas\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFj1EaNHnVmh20FnFPoUi4J-MpfQw';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-ideas\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFj1EaNHnVmh20FnFPoUi4J-MpfQw';return true;">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fpython.org%2Fpsf%2Fcodeofconduct%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJOrArSUDKkjrnthO6_CznMzkPsA';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fpython.org%2Fpsf%2Fcodeofconduct%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJOrArSUDKkjrnthO6_CznMzkPsA';return true;">http://python.org/psf/<wbr>codeofconduct/</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div></div>