mirror of https://github.com/python/cpython
Fix-up mapping equality tests to include both keys and values
This commit is contained in:
parent
48b8b665d7
commit
b0d28b4c60
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue