mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Fix-up mapping equality tests to include both keys and values
This commit is contained in:
parent
48b8b665d7
commit
b0d28b4c60
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue