MCPcopy Index your code
hub / github.com/RustPython/RustPython / __new__

Method __new__

Lib/collections/__init__.py:105–112  ·  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

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