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

Method tobytes

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

Source from the content-addressed store, hash-verified

709
710 #[pymethod]
711 fn tobytes(&self, vm: &VirtualMachine) -> PyResult<PyBytesRef> {
712 self.try_not_released(vm)?;
713 let mut v = vec![];
714 self.append_to(&mut v);
715 Ok(PyBytes::from(v).into_ref(&vm.ctx))
716 }
717
718 #[pymethod]
719 fn tolist(&self, vm: &VirtualMachine) -> PyResult<PyListRef> {

Callers

nothing calls this directly

Calls 3

try_not_releasedMethod · 0.80
append_toMethod · 0.45
into_refMethod · 0.45

Tested by

no test coverage detected