From: Raymond Hettinger Date: Tue, 22 Mar 2011 20:20:59 +0000 (-0700) Subject: Issue #11628: cmp_to_key should use__slots__. X-Git-Tag: v2.7.2rc1~228 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=911da479960a72db08154b237e8f5fd4b5ace2f4;p=thirdparty%2FPython%2Fcpython.git Issue #11628: cmp_to_key should use__slots__. --- diff --git a/Lib/functools.py b/Lib/functools.py index 01889cb0c3c7..53680b894660 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -80,6 +80,7 @@ def total_ordering(cls): 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):