Commit 906f95e8 authored by Raymond Hettinger's avatar Raymond Hettinger

Move initialization of root link to __init__.

parent f1e2df97
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment