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

Method init

crates/vm/src/builtins/bytearray.rs:689–694  ·  view source on GitHub ↗
(zelf: PyRef<Self>, options: Self::Args, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

687 type Args = ByteInnerNewOptions;
688
689 fn init(zelf: PyRef<Self>, options: Self::Args, vm: &VirtualMachine) -> PyResult<()> {
690 // First unpack bytearray and *then* get a lock to set it.
691 let mut inner = options.get_bytearray_inner(vm)?;
692 core::mem::swap(&mut *zelf.inner_mut(), &mut inner);
693 Ok(())
694 }
695}
696
697impl Comparable for PyByteArray {

Callers

nothing calls this directly

Calls 2

get_bytearray_innerMethod · 0.80
inner_mutMethod · 0.80

Tested by

no test coverage detected