Convert test_userdict to use the collections.UserDict.
Fix-up collections.UserDict.__contains__ to work correctly when __missing__ is defined.
Fix-up Mapping.__eq__ to only match instances of Mapping.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index 8090b84..ba084aa 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -379,10 +379,11 @@
return ValuesView(self)
def __eq__(self, other):
- return dict(self.items()) == dict(other.items())
+ return isinstance(other, Mapping) and \
+ dict(self.items()) == dict(other.items())
def __ne__(self, other):
- return dict(self.items()) != dict(other.items())
+ return not (self == other)
class MappingView(metaclass=ABCMeta):