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

Method __reduce__

crates/vm/src/builtins/bytearray.rs:640–647  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

638
639 #[pymethod]
640 fn __reduce__(&self, vm: &VirtualMachine) -> (PyTypeRef, PyTupleRef, Option<PyDictRef>) {
641 let bytes = PyBytes::from(self.borrow_buf().to_vec()).to_pyobject(vm);
642 (
643 self.class().to_owned(),
644 PyTuple::new_ref(vec![bytes], &vm.ctx),
645 self.as_object().dict(),
646 )
647 }
648}
649
650#[pyclass]

Callers 1

__reduce_ex__Method · 0.45

Calls 11

builtins_iterFunction · 0.85
to_vecMethod · 0.80
to_pyobjectMethod · 0.45
borrow_bufMethod · 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