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

Alexandre Brault abrault at mapgears.com
Thu May 17 08:57:12 EDT 2018


On 2018-05-17 2:03 AM, Greg Ewing wrote:
> Steven D'Aprano wrote:
>> Let's say you're reading from a CSV file, creating an object from 
>> each row, and processing it:
>
> Okay, I can see it could be useful for situations like that.
>
> But this is still a completely different use case from the
> one that started this discussion, which was making it less
> painful to add new keywords to the language. The backslash
> idea doesn't help at all with that.
>
I don't think there will a solution that makes it less painful to add 
keywords to the language, nor that finding one should be something we 
aim for. What this proposal accomplishes is help interoperation with 
other languages that have different keywords, simplify code generators 
by letting them blindly escape names and avoid mangling/demangling 
keywords, and as a distant third, an easy out if the language adds a 
keyword you use as a name.

Alex


More information about the Python-ideas mailing list