Issue #11628: cmp_to_key should use__slots__.
diff --git a/Lib/functools.py b/Lib/functools.py
index 01889cb..53680b8 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -80,6 +80,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):