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

Method getattro

crates/vm/src/builtins/function.rs:1188–1197  ·  view source on GitHub ↗
(zelf: &Py<Self>, name: &Py<PyStr>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1186
1187impl GetAttr for PyBoundMethod {
1188 fn getattro(zelf: &Py<Self>, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult {
1189 let class_attr = vm
1190 .ctx
1191 .interned_str(name)
1192 .and_then(|attr_name| zelf.get_class_attr(attr_name));
1193 if let Some(obj) = class_attr {
1194 return vm.call_if_get_descriptor(&obj, zelf.to_owned().into());
1195 }
1196 zelf.function.get_attr(name, vm)
1197 }
1198}
1199
1200impl GetDescriptor for PyBoundMethod {

Callers

nothing calls this directly

Calls 5

interned_strMethod · 0.80
get_class_attrMethod · 0.80
to_ownedMethod · 0.45
get_attrMethod · 0.45

Tested by

no test coverage detected