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

Steven D'Aprano steve at pearwood.info
Fri May 18 07:35:43 EDT 2018


On Fri, May 18, 2018 at 06:05:05PM +1200, Greg Ewing wrote:
> Steven D'Aprano wrote:
> >It's Python 3.8, and I learn that in 4.0 "spam" is going to become a 
> >keyword. I simply take my code and change all the references spam to 
> >\spam, and I've future-proofed the code for 4.0 while still keeping 
> >compatibility with 3.8 and 3.9.
> 
> Okay, maybe it helps a little bit, but not very much. There
> will still be a lot of reluctance to add new keywords, because
> of the disruption it will cause to existing code.

That's okay, in fact there *ought* to be reluctance to add new keywords. 
The aim of the exercise is not to add dozens of new keywords to the 
language, just to make it easier to deal with the situation when we do.


-- 
Steve


More information about the Python-ideas mailing list