8000 Fix-up mapping equality tests to include both keys and values · python/cpython@b0d28b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit b0d28b4

Browse files
committed
Fix-up mapping equality tests to include both keys and values
1 parent 48b8b66 commit b0d28b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_abcoll.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ def values(self):
379379
return ValuesView(self)
380380

381381
def __eq__(self, other):< 6D23 /div>
382-
return set(self) == set(other)
382+
return dict(self.items()) == dict(other.items())
383383

384384
def __ne__(self, other):
385-
return set(self) != set(other)
385+
return dict(self.items()) != dict(other.items())
386386

387387
class MappingView(metaclass=ABCMeta):
388388

0 commit comments

Comments
 (0)
0