Issue 2235: Py3k warnings are now emitted for classes that will no longer inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index 85d733f..a5fee08 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -207,6 +207,9 @@
other = self._from_iterable(other)
return (self - other) | (other - self)
+ # Sets are not hashable by default, but subclasses can change this
+ __hash__ = None
+
def _hash(self):
"""Compute the hash value of a set.
@@ -350,6 +353,9 @@
def values(self):
return [self[key] for key in self]
+ # Mappings are not hashable by default, but subclasses can change this
+ __hash__ = None
+
def __eq__(self, other):
return isinstance(other, Mapping) and \
dict(self.items()) == dict(other.items())