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

Method __setstate__

crates/vm/src/builtins/str.rs:335–341  ·  view source on GitHub ↗
(&self, state: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

333
334 #[pymethod]
335 fn __setstate__(&self, state: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
336 let mut internal = self.internal.lock();
337 internal.1 = usize::MAX;
338 internal
339 .0
340 .set_state(state, |obj, pos| pos.min(obj.char_len()), vm)
341 }
342
343 #[pymethod]
344 fn __reduce__(&self, vm: &VirtualMachine) -> PyTupleRef {

Callers

nothing calls this directly

Calls 4

set_stateMethod · 0.80
lockMethod · 0.45
minMethod · 0.45
char_lenMethod · 0.45

Tested by

no test coverage detected