]> granicus.if.org Git - python/commitdiff
Backport improved dict comparison logic
authorRaymond Hettinger <python@rcn.com>
Sat, 23 Mar 2013 13:34:19 +0000 (06:34 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 23 Mar 2013 13:34:19 +0000 (06:34 -0700)
Lib/collections/__init__.py

index 2dcc395702d4d578fa2a12a83c3698ebc1f6d002..707c53b3e15ff97d90baa3642b1913f2194b97b5 100644 (file)
@@ -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)