diff --git a/Lib/functools.py b/Lib/functools.py index fdc9c79098b..3bffbacae47 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -96,6 +96,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): diff --git a/Misc/NEWS b/Misc/NEWS index 76b42b85205..b9751b7436b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -84,6 +84,8 @@ Library - Issue #11371: Mark getopt error messages as localizable. Patch by Filip GruszczyƄski. +- 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.