MCPcopy Create free account
hub / github.com/RustPython/RustPython / new

Method new

crates/vm/src/builtins/super.rs:30–38  ·  view source on GitHub ↗
(typ: PyTypeRef, obj: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

28
29impl PySuperInner {
30 fn new(typ: PyTypeRef, obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<Self> {
31 let obj = if vm.is_none(&obj) {
32 None
33 } else {
34 let obj_type = super_check(typ.clone(), obj.clone(), vm)?;
35 Some((obj, obj_type))
36 };
37 Ok(Self { typ, obj })
38 }
39}
40
41impl PyPayload for PySuper {

Callers

nothing calls this directly

Calls 4

super_checkFunction · 0.85
SomeClass · 0.50
is_noneMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected