diff options
author | Raymond Hettinger <python@rcn.com> | 2009-03-23 04:42:18 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-03-23 04:42:18 (GMT) |
commit | 906f95e80bfdd801470cf8225ff9e6f99cd98187 (patch) | |
tree | 73fe6589431aa4d6509ed45d209da5cf7966983a /Lib/collections.py | |
parent | f1e2df978070319b97252ad077690739c31b461e (diff) | |
download | cpython-906f95e80bfdd801470cf8225ff9e6f99cd98187.zip cpython-906f95e80bfdd801470cf8225ff9e6f99cd98187.tar.gz cpython-906f95e80bfdd801470cf8225ff9e6f99cd98187.tar.bz2 |
Move initialization of root link to __init__.
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index 2c2355e..f0f1fbb 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -41,11 +41,12 @@ class OrderedDict(dict, MutableMapping): try: self.__root except AttributeError: + self.__root = _Link() # sentinel node for the doubly linked list self.clear() self.update(*args, **kwds) def clear(self): - self.__root = root = _Link() # sentinel node for the doubly linked list + root = self.__root root.prev = root.next = root self.__map = {} dict.clear(self) |