mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #11628: cmp_to_key should use __slots__.
This commit is contained in:
parent
779a5b0b3a
commit
a0d1d96771
2 changed files with 3 additions and 0 deletions
|
@ -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):
|
||||
|
|
|
@ -49,6 +49,8 @@ Core and Builtins
|
|||
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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue