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

Function setattro_wrapper

crates/vm/src/types/slot.rs:523–539  ·  view source on GitHub ↗
(
    zelf: &PyObject,
    name: &Py<PyStr>,
    value: PySetterValue,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

521}
522
523fn setattro_wrapper(
524 zelf: &PyObject,
525 name: &Py<PyStr>,
526 value: PySetterValue,
527 vm: &VirtualMachine,
528) -> PyResult<()> {
529 let name = name.to_owned();
530 match value {
531 PySetterValue::Assign(value) => {
532 vm.call_special_method(zelf, identifier!(vm, __setattr__), (name, value))?;
533 }
534 PySetterValue::Delete => {
535 vm.call_special_method(zelf, identifier!(vm, __delattr__), (name,))?;
536 }
537 };
538 Ok(())
539}
540
541pub(crate) fn richcompare_wrapper(
542 zelf: &PyObject,

Callers

nothing calls this directly

Calls 2

call_special_methodMethod · 0.80
to_ownedMethod · 0.45

Tested by

no test coverage detected