[Python-Dev] Assignment to None

Gisle Aas gisle at activestate.com
Mon Jun 9 19:18:10 CEST 2008


On Jun 9, 2008, at 17:12, Alex Martelli wrote:

> The problem is more general: what if a member  (of some external
> object we're proxying one way or another) is named print (in Python <
> 3), or class, or...?  To allow foo.print or bar.class would require
> pretty big changes to Python's parser

I simple solution to this would be to introduce syntax that allow you  
to "quote" identifiers that would otherwise be lexed as keywords.   
For instance C# uses a prefix '@' for such quoting, so you could  
write foo. at print, bar. at class and baz. at None if you insist on using  
such identifiers.  Too ugly for Python I guess.

Regards,
Gisle



More information about the Python-Dev mailing list