From: Raymond Hettinger Date: Mon, 23 Mar 2009 04:42:18 +0000 (+0000) Subject: Move initialization of root link to __init__. X-Git-Tag: v2.7a1~1821 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=906f95e80bfdd801470cf8225ff9e6f99cd98187;p=thirdparty%2FPython%2Fcpython.git Move initialization of root link to __init__. --- diff --git a/Lib/collections.py b/Lib/collections.py index 2c2355ee1e8b..f0f1fbbe2903 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)