Fix-up mapping equality tests to include both keys and values

This commit is contained in:
Raymond Hettinger 2008-02-05 12:10:29 +00:00
parent 48b8b665d7
commit b0d28b4c60
1 changed files with 2 additions and 2 deletions

View 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):