From: Raymond Hettinger Date: Sat, 23 Mar 2013 13:34:19 +0000 (-0700) Subject: Backport improved dict comparison logic X-Git-Tag: v3.3.1rc1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=325dc887caa15534309f4b7c419fadcd0bb1be7d;p=python Backport improved dict comparison logic --- diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index 2dcc395702..707c53b3e1 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -228,8 +228,7 @@ class OrderedDict(dict): ''' if isinstance(other, OrderedDict): - return len(self)==len(other) and \ - all(map(_eq, self.items(), other.items())) + return dict.__eq__(self, other) and all(map(_eq, self, other)) return dict.__eq__(self, other)