From 911da479960a72db08154b237e8f5fd4b5ace2f4 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 22 Mar 2011 13:20:59 -0700 Subject: [PATCH] Issue #11628: cmp_to_key should use__slots__. --- Lib/functools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/functools.py b/Lib/functools.py index 01889cb0c3c..53680b89466 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):