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

Todd toddrjen at gmail.com
Wed May 16 15:40:40 EDT 2018


On Wed, May 16, 2018 at 2:17 PM, Carl Smith <carl.input at gmail.com> wrote:

> > Not if you need to make changes in the same tens of thousands of lines
> file.
>
> But what has that got to do with the the syntax of the new code? The old
> code is
> what it is.
>
>
Again, because you end up with hard-to-debug issues through no fault of
your own.


> I did think after I replied that `True` wasn't actually reserved until
> more recently, but
> the point still stands: You would be able to reference the name *as
> defined* in an
> external library, and yeah, it could refer to anything, but that's kinda
> the point. We
> have to assume the library does something sane with the name. We can't
> preempt
> an employee sabotaging `True`.
>
>
We can and do preempt someone sabotaging a keywords by not letting anyone
override them.  That is the whole point of using reserved keywords.  Some
languages allow you to change important words, some don't.  Guido made a
conscious decision to make certain words keywords, and to not let anyone
change them, I believe to avoid the sorts of issues I have brought up.  You
are talking about removing one of the most important and long-standing
protections the language has in place.  That is not a small change.


> -- Carl Smith
> carl.input at gmail.com
>
> On 16 May 2018 at 16:40, Niki Spahiev <niki.spahiev at gmail.com> wrote:
>
>> On 16.05.2018 16:05, Andrés Delfino wrote:
>>
>>> IMHO, it would be much easier to learn and understand if keywords can
>>> only
>>> be used by escaping them, instead of depending where they occur.
>>>
>>
>> There can be 2 escape characters '\' and '.'
>>
>> Niki
>>
>>
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> 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/20180516/e57b90fc/attachment.html>


More information about the Python-ideas mailing list