[Patches] [ python-Patches-852140 ] keyword.py - use __contains__ and bool

SourceForge.net noreply at sourceforge.net
Tue Dec 2 02:50:25 EST 2003


Patches item #852140, was opened at 2003-12-01 10:43
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=852140&group_id=5470

Category: Library (Lib)
>Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Gerrit Holl (gerrit)
Assigned to: Nobody/Anonymous (nobody)
Summary: keyword.py - use __contains__ and bool

Initial Comment:
This patch provides two micro changes to keyword.py.
Instead of building the dict with value 1, it is built
with value True. And instead of having iskeyword be an
alias of kwdict.has_key, it makes iskeyword an alias
for kwdict.__contains__.

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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-12-02 02:50

Message:
Logged In: YES 
user_id=80475

Improved the patch and made the change in Lib/keyword.py 1.13.

The newline reads:
   iskeyword = frozenset(kwlist).__contains__

Not applied to Py2.3.  Those changes are limited to
bugfixes, not implementation improvements.

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

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



More information about the Patches mailing list