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

Function setitem_wrapper

crates/vm/src/types/slot.rs:390–401  ·  view source on GitHub ↗
(
    obj: &PyObject,
    needle: K,
    value: Option<PyObjectRef>,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

388}
389
390fn setitem_wrapper<K: ToPyObject>(
391 obj: &PyObject,
392 needle: K,
393 value: Option<PyObjectRef>,
394 vm: &VirtualMachine,
395) -> PyResult<()> {
396 match value {
397 Some(value) => vm.call_special_method(obj, identifier!(vm, __setitem__), (needle, value)),
398 None => vm.call_special_method(obj, identifier!(vm, __delitem__), (needle,)),
399 }
400 .map(drop)
401}
402
403#[inline(never)]
404fn mapping_setitem_wrapper(

Callers 2

mapping_setitem_wrapperFunction · 0.85
sequence_setitem_wrapperFunction · 0.85

Calls 2

call_special_methodMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected