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

Method __setitem__

core/src/stdlib/pyscript/storage.py:164–173  ·  view source on GitHub ↗

Set a `key` to a `value` in storage. The change is queued for persistence. Use `sync()` to ensure immediate completion. The `value` must be a supported type for serialization.

(self, key, value)

Source from the content-addressed store, hash-verified

162 super().__delitem__(key)
163
164 def __setitem__(self, key, value):
165 """
166 Set a `key` to a `value` in storage.
167
168 The change is queued for persistence. Use `sync()` to ensure
169 immediate completion. The `value` must be a supported type for
170 serialization.
171 """
172 self._store.set(key, _convert_to_idb(value))
173 super().__setitem__(key, value)
174
175 def clear(self):
176 """

Callers

nothing calls this directly

Calls 2

_convert_to_idbFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected