[Python-ideas] Verbatim names (allowing keywords as names)

Neil Girdhar mistersheik at gmail.com
Thu May 17 18:11:14 EDT 2018



On Thursday, May 17, 2018 at 5:55:30 PM UTC-4, Carl Smith wrote:
>
> > I believe this is the first proposal that allows future-proofing of new 
> code while preserving
> > complete backward compatibility.
>
> My proposal removes the need to future proof anything, and only requires
> subtle changes to the syntax (nothing visually different). It also 
> preserves
> perfect backwards compatibility. Just saying :)
>
> Maybe I misunderstood, but it seems like your solution places a small 
burden on new code that uses "given" or "where" or whatever in the form of 
a special import or statement enabling it.  I love that we're instead 
making it easy to keep old code working while protecting Python's beautiful 
future with no special imports or statements to use the core language.   

>
>
> -- Carl Smith
> carl.... at gmail.com <javascript:>
>
> On 17 May 2018 at 22:38, Rob Cliffe via Python-ideas <python... at python.org 
> <javascript:>> wrote:
>
>>
>>
>> On 16/05/2018 10:12, Stephan Houben wrote:
>>
>>> Hi all,
>>>
>>> One problem already alluded to with the \identifier syntax is that it 
>>> only works
>>> if the old Python version is sufficiently recent to understand \.
>>>
>>> What about using parentheses to allow a keyword to be used as an 
>>> identifier:
>>> (where)(x, y)
>>>
>>>
>>> I believe this is the first proposal that allows future-proofing of new 
>> code while preserving complete backward compatibility.  As far as I 
>> know,    ( keyword )    is never legal syntax.
>> Of course, putting brackets round every occurrence of every identifier 
>> that you think might become an identifier in the next century is a bit of a 
>> chore.  There is no perfect solution.
>> Best wishes
>> Rob Cliffe
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python... at python.org <javascript:>
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180517/3ae85657/attachment.html>


More information about the Python-ideas mailing list