]> granicus.if.org Git - python/commitdiff
Improve OrderedDict equality test.
authorRaymond Hettinger <python@rcn.com>
Fri, 7 Dec 2012 18:18:22 +0000 (10:18 -0800)
committerRaymond Hettinger <python@rcn.com>
Fri, 7 Dec 2012 18:18:22 +0000 (10:18 -0800)
Lib/collections/__init__.py

index e5f9599b0ae981fb289a43ea8780ea648a8ee23c..53083e4bd64adaabe57bf241cf7c4577c4e275a0 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)