From: Raymond Hettinger Date: Fri, 7 Dec 2012 18:18:22 +0000 (-0800) Subject: Improve OrderedDict equality test. X-Git-Tag: v3.4.0a1~1896 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=527507d72ef2374ecd9f53f1a0a3c00783b73f4e;p=python Improve OrderedDict equality test. --- diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index e5f9599b0a..53083e4bd6 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)