[Python-checkins] cpython (3.2): Issue #11628: cmp_to_key should use __slots__.
raymond.hettinger
python-checkins at python.org
Tue Mar 22 01:54:34 CET 2011
http://hg.python.org/cpython/rev/97799a54728e
changeset: 68824:97799a54728e
branch: 3.2
parent: 68814:f51128a6dc24
user: Raymond Hettinger <python at rcn.com>
date: Mon Mar 21 17:50:28 2011 -0700
summary:
Issue #11628: cmp_to_key should use __slots__.
files:
Lib/functools.py
Misc/NEWS
diff --git a/Lib/functools.py b/Lib/functools.py
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -96,6 +96,7 @@
def cmp_to_key(mycmp):
"""Convert a cmp= function into a key= function"""
class K(object):
+ __slots__ = ['obj']
def __init__(self, obj, *args):
self.obj = obj
def __lt__(self, other):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -49,6 +49,8 @@
Library
-------
+- Issue #11628: cmp_to_key generated class should use __slots__
+
- Issue #5537: Fix time2isoz() and time2netscape() functions of
httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list