<div dir="ltr"><div>I like it. I much prefer \ to $ since in most languages that use $ that I know of (Perl, shell) there's a world of difference between $foo and foo whenever they occur (basically they never mean the same thing), whereas at least in shell, \foo means the same thing as foo *unless* foo would otherwise have a special meaning.</div><div><br></div><div>I also recall that in some Fortran dialect I once used, $ was treated as the 27th letter of the alphabet, but not in the language standard. See e.g. <a href="https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Dollar-Signs.html">https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Dollar-Signs.html</a>. Apparently it has a similar role in Java (<a href="https://stackoverflow.com/questions/7484210/what-is-the-meaning-of-in-a-variable-name">https://stackoverflow.com/questions/7484210/what-is-the-meaning-of-in-a-variable-name</a>).<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 15, 2018 at 8:41 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Inspired by Alex Brault's  post:<br>
<br>
<a href="https://mail.python.org/pipermail/python-ideas/2018-May/050750.html" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>pipermail/python-ideas/2018-<wbr>May/050750.html</a><br>
<br>
I'd like to suggest we copy C#'s idea of verbatim identifiers, but using <br>
a backslash rather than @ sign:<br>
<br>
    \name<br>
<br>
would allow "name" to be used as an identifier, even if it clashes with <br>
a keyword.<br>
<br>
It would *not* allow the use of characters that aren't valid in <br>
identifiers, e.g. this is out: \na!me  # still not legal<br>
<br>
See usage #1 here:<br>
<br>
<a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/verbatim" rel="noreferrer" target="_blank">https://docs.microsoft.com/en-<wbr>us/dotnet/csharp/language-<wbr>reference/tokens/verbatim</a><br>
<br>
<br>
If "verbatim name" is too long, we could call them "raw names", by <br>
analogy with raw strings.<br>
<br>
I believe that \ is currently illegal in any Python expression, except <br>
inside strings and at the very end of the line, so this ought to be <br>
syntactically unambgiguous.<br>
<br>
We should still include a (mild?) recommendation against using keywords <br>
unless necessary, and a (strong?) preference for the trailing underscore <br>
convention. But I think this doesn't look too bad:<br>
<br>
    of = 'output.txt'<br>
    \if = 'input.txt'<br>
    with open(\if, 'r'):<br>
        with open(of, 'w'):<br>
            of.write(\if.read())<br>
<br>
maybe even nicer than if_.<br>
<br>
Some examples:<br>
<br>
    result = \except + 1<br>
<br>
    result = something.\except<br>
<br>
    result = \except.\finally<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Steve<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>