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

Method _from_bytes

crates/stdlib/src/array.rs:849–857  ·  view source on GitHub ↗
(&self, b: &[u8], itemsize: usize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

847 }
848
849 fn _from_bytes(&self, b: &[u8], itemsize: usize, vm: &VirtualMachine) -> PyResult<()> {
850 if !b.len().is_multiple_of(itemsize) {
851 return Err(vm.new_value_error("bytes length not a multiple of item size"));
852 }
853 if b.len() / itemsize > 0 {
854 self.try_resizable(vm)?.frombytes(b);
855 }
856 Ok(())
857 }
858
859 #[pymethod]
860 fn frombytes(&self, b: ArgBytesLike, vm: &VirtualMachine) -> PyResult<()> {

Callers 2

frombytesMethod · 0.80
fromfileMethod · 0.80

Calls 4

frombytesMethod · 0.80
try_resizableMethod · 0.80
ErrClass · 0.50
lenMethod · 0.45

Tested by

no test coverage detected