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

Function common_reduce

crates/vm/src/builtins/object.rs:751–759  ·  view source on GitHub ↗
(obj: PyObjectRef, proto: usize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

749}
750
751fn common_reduce(obj: PyObjectRef, proto: usize, vm: &VirtualMachine) -> PyResult {
752 if proto >= 2 {
753 reduce_newobj(obj, vm)
754 } else {
755 let copyreg = vm.import("copyreg", 0)?;
756 let reduce_ex = copyreg.get_attr("_reduce_ex", vm)?;
757 reduce_ex.call((obj, proto), vm)
758 }
759}

Callers 2

__reduce__Method · 0.85
__reduce_ex__Method · 0.85

Calls 4

reduce_newobjFunction · 0.85
importMethod · 0.45
get_attrMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected