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

Function getattro_wrapper

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

Source from the content-addressed store, hash-verified

506}
507
508fn getattro_wrapper(zelf: &PyObject, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult {
509 let __getattribute__ = identifier!(vm, __getattribute__);
510 let __getattr__ = identifier!(vm, __getattr__);
511 match vm.call_special_method(zelf, __getattribute__, (name.to_owned(),)) {
512 Ok(r) => Ok(r),
513 Err(e)
514 if e.fast_isinstance(vm.ctx.exceptions.attribute_error)
515 && zelf.class().has_attr(__getattr__) =>
516 {
517 vm.call_special_method(zelf, __getattr__, (name.to_owned(),))
518 }
519 Err(e) => Err(e),
520 }
521}
522
523fn setattro_wrapper(
524 zelf: &PyObject,

Callers

nothing calls this directly

Calls 6

call_special_methodMethod · 0.80
fast_isinstanceMethod · 0.80
ErrClass · 0.50
to_ownedMethod · 0.45
has_attrMethod · 0.45
classMethod · 0.45

Tested by

no test coverage detected