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

Method __setitem__

Lib/collections/__init__.py:120–132  ·  view source on GitHub ↗

od.__setitem__(i, y) <==> od[i]=y

(self, key, value,
                    dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link)

Source from the content-addressed store, hash-verified

118 self.__update(other, **kwds)
119
120 def __setitem__(self, key, value,
121 dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
122 'od.__setitem__(i, y) <==> od[i]=y'
123 # Setting a new item creates a new link at the end of the linked list,
124 # and the inherited dictionary is updated with the new key/value pair.
125 if key not in self:
126 self.__map[key] = link = Link()
127 root = self.__root
128 last = root.prev
129 link.prev, link.next, link.key = last, root, key
130 last.next = link
131 root.prev = proxy(link)
132 dict_setitem(self, key, value)
133
134 def __delitem__(self, key, dict_delitem=dict.__delitem__):
135 'od.__delitem__(y) <==> del od[y]'

Callers

nothing calls this directly

Calls 2

LinkInterface · 0.85
proxyFunction · 0.85

Tested by

no test coverage detected