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

SourceForge.net noreply at sourceforge.net
Fri May 26 22:17:03 CEST 2006


Patches item #1492218, was opened at 2006-05-20 20:43
Message generated for change (Comment added) made by gbrandl
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: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
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: Georg Brandl (gbrandl)
Date: 2006-05-26 20:17

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

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

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

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

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

Comment By: Žiga Seilnacht (zseil)
Date: 2006-05-22 11: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 09: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