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

Method resize

crates/vm/src/builtins/bytearray.rs:551–557  ·  view source on GitHub ↗
(&self, size: isize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

549
550 #[pymethod]
551 fn resize(&self, size: isize, vm: &VirtualMachine) -> PyResult<()> {
552 if size < 0 {
553 return Err(vm.new_value_error("bytearray.resize(): new size must be >= 0"));
554 }
555 self.try_resizable(vm)?.elements.resize(size as usize, 0);
556 Ok(())
557 }
558
559 // TODO: Uncomment when Python adds __class_getitem__ to bytearray
560 // #[pyclassmethod]

Callers 10

_getfinalpathnameFunction · 0.45
_getfullpathnameFunction · 0.45
listmountsFunction · 0.45
EnumValueFunction · 0.45
QueryValueFunction · 0.45
QueryValueExFunction · 0.45
parseMethod · 0.45
readallMethod · 0.45
instrument_codeFunction · 0.45
value_to_bytes_endianFunction · 0.45

Calls 2

try_resizableMethod · 0.80
ErrClass · 0.50

Tested by

no test coverage detected