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

Method set_item

crates/vm/src/builtins/dict.rs:713–724  ·  view source on GitHub ↗
(
        &self,
        key: &K,
        value: PyObjectRef,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

711 }
712
713 pub fn set_item<K: DictKey + ?Sized>(
714 &self,
715 key: &K,
716 value: PyObjectRef,
717 vm: &VirtualMachine,
718 ) -> PyResult<()> {
719 if self.exact_dict(vm) {
720 self.inner_setitem(key, value, vm)
721 } else {
722 self.as_object().set_item(key, value, vm)
723 }
724 }
725
726 pub fn del_item<K: DictKey + ?Sized>(&self, key: &K, vm: &VirtualMachine) -> PyResult<()> {
727 if self.exact_dict(vm) {

Callers 15

bench_cpython_codeFunction · 0.45
bench_rustpython_codeFunction · 0.45
runFunction · 0.45
add_to_scopeMethod · 0.45
inject_moduleMethod · 0.45
inject_js_moduleMethod · 0.45
js_to_pyFunction · 0.45
get_ciphersMethod · 0.45
cert_store_statsMethod · 0.45
flagsFunction · 0.45
delMethod · 0.45
task_step_implFunction · 0.45

Calls 3

exact_dictMethod · 0.80
inner_setitemMethod · 0.80
as_objectMethod · 0.45

Tested by 1