[Python-Dev] Making None a keyword

Greg Ewing greg@cosc.canterbury.ac.nz
Tue, 30 Apr 2002 16:13:53 +1200 (NZST)


Guido:

> atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}'
>   | '`' testlist '`' | NAME | NUMBER | STRING+ | 'None'
> 
> It needs to add 'None' as an alternative to all other places where
> currently NAME occurs.

Wait a minute, you're going about this all wrong!

Instead of making None a reserved word, why not just make it
a non-reserved keyword when used as a variable name? Then
you wouldn't have to change the grammar at all, and there
would be no problem with the use of None in other contexts,
such as attribute names.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+