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

Method __reduce__

crates/vm/src/builtins/map.rs:64–74  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

62
63 #[pymethod]
64 fn __reduce__(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyTupleRef> {
65 let cls = zelf.class().to_owned();
66 let mut vec = vec![zelf.mapper.clone()];
67 vec.extend(zelf.iterators.iter().map(|o| o.clone().into()));
68 let tuple_args = vm.ctx.new_tuple(vec);
69 Ok(if zelf.strict.load(atomic::Ordering::Acquire) {
70 vm.new_tuple((cls, tuple_args, true))
71 } else {
72 vm.new_tuple((cls, tuple_args))
73 })
74 }
75
76 #[pymethod]
77 fn __setstate__(zelf: PyRef<Self>, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 8

to_ownedMethod · 0.45
classMethod · 0.45
extendMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
new_tupleMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected