From 527507d72ef2374ecd9f53f1a0a3c00783b73f4e Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 7 Dec 2012 10:18:22 -0800 Subject: Improve OrderedDict equality test. --- Lib/collections/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index e5f9599..53083e4 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) -- cgit v0.12