class MappingView(Sized):
+ __slots__ = '_mapping',
+
def __init__(self, mapping):
self._mapping = mapping
class KeysView(MappingView, Set):
+ __slots__ = ()
+
@classmethod
def _from_iterable(self, it):
return set(it)
class ItemsView(MappingView, Set):
+ __slots__ = ()
+
@classmethod
def _from_iterable(self, it):
return set(it)
class ValuesView(MappingView):
+ __slots__ = ()
+
def __contains__(self, value):
for key in self._mapping:
if value == self._mapping[key]:
Decimal.quantize() method in the Python version. It had never been
present in the C version.
+- Issue #21421: Add __slots__ to the MappingViews ABC.
+ Patch by Josh Rosenberg.
+
- Issue #21101: Eliminate double hashing in the C speed-up code for
collections.Counter().