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

Method __reduce__

crates/vm/src/exceptions.rs:710–716  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

708
709 #[pymethod]
710 fn __reduce__(self, vm: &VirtualMachine) -> PyTupleRef {
711 if let Some(dict) = self.as_object().dict().filter(|x| !x.is_empty()) {
712 vm.new_tuple((self.class().to_owned(), self.args(), dict))
713 } else {
714 vm.new_tuple((self.class().to_owned(), self.args()))
715 }
716 }
717
718 #[pymethod]
719 fn __setstate__(self, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyObjectRef> {

Callers

nothing calls this directly

Calls 15

into_pytupleMethod · 0.80
okMethod · 0.80
noneMethod · 0.80
filterMethod · 0.45
dictMethod · 0.45
as_objectMethod · 0.45
is_emptyMethod · 0.45
new_tupleMethod · 0.45
to_ownedMethod · 0.45
classMethod · 0.45
argsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected