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

Function get_impl

crates/vm/src/stdlib/_abc.rs:76–81  ·  view source on GitHub ↗

Get the _abc_impl attribute from an ABC class

(cls: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

74
75 /// Get the _abc_impl attribute from an ABC class
76 fn get_impl(cls: &PyObject, vm: &VirtualMachine) -> PyResult<PyRef<AbcData>> {
77 let impl_obj = cls.get_attr("_abc_impl", vm)?;
78 impl_obj
79 .downcast::<AbcData>()
80 .map_err(|_| vm.new_type_error("_abc_impl is set to a wrong type"))
81 }
82
83 /// Check if obj is in the weak set
84 fn in_weak_set(

Callers 6

_abc_registerFunction · 0.85
_abc_instancecheckFunction · 0.85
_abc_subclasscheckFunction · 0.85
_get_dumpFunction · 0.85
_reset_registryFunction · 0.85
_reset_cachesFunction · 0.85

Calls 1

get_attrMethod · 0.45

Tested by

no test coverage detected