(&self, size: isize, vm: &VirtualMachine)
| 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] |
no test coverage detected