From b0d28b4c607709fdeb395b558cc7c87bad0869f0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 5 Feb 2008 12:10:29 +0000 Subject: [PATCH] Fix-up mapping equality tests to include both keys and values --- Lib/_abcoll.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 9bcaae928c1..8090b845b29 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -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):