<div dir="ltr"><div><div><div><div>OK, that was a silly joke, but<br></div>did you realize that the following already WORKS TODAY:<br><br>>>> class Foo:<br>...  pass<br>>>> f = Foo()<br>>>> f.__dict__["if"] = 42<br>>>> f.𝐢𝐟<br>42<br><br></div>That's right, I can access a member whose name is a keyword<br></div>by simply using Unicode bold.<br><br></div><div>Because Python normalizes Unicode fonts but  this is<br></div><div>apparently AFTER keywords have been recognized.<br></div><div><br></div>Stephan<br><div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-17 19:53 GMT+02:00 Stephan Houben <span dir="ltr"><<a href="mailto:stephanh42@gmail.com" target="_blank">stephanh42@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 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!<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Stephan<br></div></font></span><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2018-05-17 19:10 GMT+02:00 Chris Barker via Python-ideas <span dir="ltr"><<a href="mailto:python-ideas@python.org" target="_blank">python-ideas@python.org</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_-808596683805088731gmail-">On Wed, May 16, 2018 at 2:09 PM, Carl Smith <span dir="ltr"><<a href="mailto:carl.input@gmail.com" target="_blank">carl.input@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 class="m_-808596683805088731gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="m_-808596683805088731gmail-HOEnZb"><font color="#888888"><div><br></div><div><br></div></font></span></div><span class="m_-808596683805088731gmail-HOEnZb"><font color="#888888">-- <br><div class="m_-808596683805088731gmail-m_-2954257570645290355gmail_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>
</font></span></div></div>
<br></div></div><span class="">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
<br></span></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>