From: Raymond Hettinger Date: Sun, 10 Jun 2012 05:51:39 +0000 (-0700) Subject: Small cleanup and optimization X-Git-Tag: v3.3.0b1~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c2018c311351ff90b0c278f289291822bcd1e83;p=python Small cleanup and optimization --- diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index 355c0c1878..e5f9599b0a 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -8,7 +8,7 @@ import collections.abc __all__ += collections.abc.__all__ from _collections import deque, defaultdict -from operator import itemgetter as _itemgetter +from operator import itemgetter as _itemgetter, eq as _eq from keyword import iskeyword as _iskeyword import sys as _sys import heapq as _heapq @@ -229,7 +229,7 @@ class OrderedDict(dict): ''' if isinstance(other, OrderedDict): return len(self)==len(other) and \ - all(p==q for p, q in zip(self.items(), other.items())) + all(map(_eq, self.items(), other.items())) return dict.__eq__(self, other)