MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __setitem__

Method __setitem__

tools/python-3.11.9-amd64/Lib/shelve.py:119–125  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

117 return value
118
119 def __setitem__(self, key, value):
120 if self.writeback:
121 self.cache[key] = value
122 f = BytesIO()
123 p = Pickler(f, self._protocol)
124 p.dump(value)
125 self.dict[key.encode(self.keyencoding)] = f.getvalue()
126
127 def __delitem__(self, key):
128 del self.dict[key.encode(self.keyencoding)]

Callers

nothing calls this directly

Calls 4

getvalueMethod · 0.95
BytesIOClass · 0.90
dumpMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected