diff options
author | Raymond Hettinger <python@rcn.com> | 2009-03-23 18:26:59 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-03-23 18:26:59 (GMT) |
commit | e5b78563b6f394e69d87ee68cc82c173c95dfa0b (patch) | |
tree | 8f729b5c789d8013664c0d12e004b602730f52d0 /Lib | |
parent | 0b666bfdf94b04af370d28806f16a9977d6f5792 (diff) | |
download | cpython-e5b78563b6f394e69d87ee68cc82c173c95dfa0b.zip cpython-e5b78563b6f394e69d87ee68cc82c173c95dfa0b.tar.gz cpython-e5b78563b6f394e69d87ee68cc82c173c95dfa0b.tar.bz2 |
Make imported name private and wrap long-line.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/collections.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index f0f1fbb..da59608 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -10,7 +10,7 @@ from operator import itemgetter as _itemgetter, eq as _eq from keyword import iskeyword as _iskeyword import sys as _sys import heapq as _heapq -from weakref import proxy +from weakref import proxy as _proxy from itertools import repeat as _repeat, chain as _chain, starmap as _starmap, \ ifilter as _ifilter, imap as _imap, izip as _izip @@ -59,7 +59,7 @@ class OrderedDict(dict, MutableMapping): root = self.__root last = root.prev link.prev, link.next, link.key = last, root, key - last.next = root.prev = proxy(link) + last.next = root.prev = _proxy(link) dict.__setitem__(self, key, value) def __delitem__(self, key): @@ -131,7 +131,8 @@ class OrderedDict(dict, MutableMapping): def __eq__(self, other): if isinstance(other, OrderedDict): - return len(self)==len(other) and all(_imap(_eq, self.items(), other.items())) + return len(self)==len(other) and \ + all(_imap(_eq, self.iteritems(), other.iteritems())) return dict.__eq__(self, other) |