[Python-Dev] Making None a keyword
Guido van Rossum
guido@python.org
Thu, 25 Apr 2002 23:53:44 -0400
> I think it's a small project. We've got a new node type in the
> grammar -- None -- and we'll need a new opcode -- LOAD_NONE. The
> compiler just needs to generate a LOAD_NONE for every None node.
>
> Does the parser prevent assignment to None? Or does the compiler need
> to check for the use of None in an assignment?
The compiler needs to check. It's just like assigning to a literal:
the parser has no power to prevent this, so the compiler has to act as
a safeguard.
--Guido van Rossum (home page: http://www.python.org/~guido/)