]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix-up mapping equality tests to include both keys and values
authorRaymond Hettinger <python@rcn.com>
Tue, 5 Feb 2008 12:10:29 +0000 (12:10 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 5 Feb 2008 12:10:29 +0000 (12:10 +0000)
Lib/_abcoll.py

index 9bcaae928c1c73dbdbbc0fb45c4e39c49f2ec94e..8090b845b29e2a20582860f6f62a05b7a70091fc 100644 (file)
@@ -379,10 +379,10 @@ class Mapping(metaclass=ABCMeta):
         return ValuesView(self)
 
     def __eq__(self, other):
-        return set(self) == set(other)
+        return dict(self.items()) == dict(other.items())
 
     def __ne__(self, other):
-        return set(self) != set(other)
+        return dict(self.items()) != dict(other.items())
 
 class MappingView(metaclass=ABCMeta):