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

Method __reduce__

crates/vm/src/builtins/bytes.rs:553–560  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

551
552 #[pymethod]
553 fn __reduce__(&self, vm: &VirtualMachine) -> (PyTypeRef, PyTupleRef, Option<PyDictRef>) {
554 let bytes = PyBytes::from(self.to_vec()).to_pyobject(vm);
555 (
556 self.class().to_owned(),
557 PyTuple::new_ref(vec![bytes], &vm.ctx),
558 self.as_object().dict(),
559 )
560 }
561}
562
563#[pyclass]

Callers 1

__reduce_ex__Method · 0.45

Calls 10

builtins_iterFunction · 0.85
to_vecMethod · 0.80
to_pyobjectMethod · 0.45
to_ownedMethod · 0.45
classMethod · 0.45
dictMethod · 0.45
as_objectMethod · 0.45
reduceMethod · 0.45
lockMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected