diff options
author | Raymond Hettinger <python@rcn.com> | 2009-03-02 21:28:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-03-02 21:28:41 (GMT) |
commit | ea9f8db2a28b3a99e3007314795a0c27de1bd80f (patch) | |
tree | 2b888df196688f1e042a70ce1b8a6fa46ff3c193 /Lib/collections.py | |
parent | 2d32f63ec9bef3c78144557e5b2984f9b56a3294 (diff) | |
download | cpython-ea9f8db2a28b3a99e3007314795a0c27de1bd80f.zip cpython-ea9f8db2a28b3a99e3007314795a0c27de1bd80f.tar.gz cpython-ea9f8db2a28b3a99e3007314795a0c27de1bd80f.tar.bz2 |
Missed my last update to __eq__ to check matching length.
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index b65e12f..c731a9a 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -11,8 +11,7 @@ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys import heapq as _heapq -from itertools import repeat as _repeat, chain as _chain, starmap as _starmap, \ - zip_longest as _zip_longest +from itertools import repeat as _repeat, chain as _chain, starmap as _starmap ################################################################################ ### OrderedDict @@ -83,7 +82,7 @@ class OrderedDict(dict, MutableMapping): def __eq__(self, other): if isinstance(other, OrderedDict): - return all(p==q for p, q in _zip_longest(self.items(), other.items())) + return len(self)==len(other) and all(p==q for p, q in zip(self.items(), other.items())) return dict.__eq__(self, other) |