None became a keyword in Python 2.4, but this is not evident from the Python/gramminit.c file. As a consequence, None is not included in the keyword module when you regenerate it. This patch also includes documentation fixes (None was missing from keywords section in reference manual) and fixes for syntax highliting for Idle and Vim. python-mode.el already treats None, True and False differently, so I didn't try to change it.
Logged In: YES user_id=21627 None is not a keyword. Watch this: >>> def None():pass SyntaxError: assignment to None >>> def while():pass SyntaxError: invalid syntax >>> None remains an identifier, but assignments to None are not allowed.
Logged In: YES user_id=1326842 I realise that None is a constant, not a keyword. Could at least the documentation be changed? Currently the reference manual says: "The following identifiers are used as reserved words, or keywords of the language, and cannot be used as ordinary identifiers." A list that doesn't include None follows, but as your example shows, None also can't be used as an ordinary identifier. Later on that page: "In some future version of Python, the identifier None will become a keyword." See: http://docs.python.org/dev/ref/keywords.html
Logged In: YES user_id=1326842 Attaching a new set of patches. Since they only affect the documentation, I also changed the category. The patch against the trunk also includes a note that using "as" and "with" as identifiers will issue a warning.
Logged In: YES user_id=849994 Committed your patches in rev. 46411, 46412. Note that the optional text in \versionchanged mustn't have a trailing period though...