MCPcopy Index your code
hub / github.com/python/cpython / __new__

Method __new__

Lib/collections/__init__.py:104–111  ·  view source on GitHub ↗

Create the ordered dict object and set up the underlying structures.

(cls, /, *args, **kwds)

Source from the content-addressed store, hash-verified

102 # Those hard references disappear when a key is deleted from an OrderedDict.
103
104 def __new__(cls, /, *args, **kwds):
105 "Create the ordered dict object and set up the underlying structures."
106 self = dict.__new__(cls)
107 self.__hardroot = _Link()
108 self.__root = root = _proxy(self.__hardroot)
109 root.prev = root.next = root
110 self.__map = {}
111 return self
112
113 def __init__(self, other=(), /, **kwds):
114 '''Initialize an ordered dictionary. The signature is the same as

Callers 2

__copy__Method · 0.45
__copy__Method · 0.45

Calls 1

_LinkClass · 0.85

Tested by

no test coverage detected