[Patches] [ python-Patches-1492218 ] None missing from keyword module

SourceForge.net noreply at sourceforge.net
Mon May 22 13:04:23 CEST 2006


Patches item #1492218, was opened at 2006-05-20 22:43
Message generated for change (Comment added) made by zseil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1492218&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Žiga Seilnacht (zseil)
Assigned to: Nobody/Anonymous (nobody)
Summary: None missing from keyword module

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Žiga Seilnacht (zseil)
Date: 2006-05-22 13:04

Message:
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

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2006-05-22 11:26

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1492218&group_id=5470


More information about the Patches mailing list