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

Method remove

crates/vm/src/builtins/bytearray.rs:603–611  ·  view source on GitHub ↗
(&self, object: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

601
602 #[pymethod]
603 fn remove(&self, object: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
604 let value = value_from_object(vm, &object)?;
605 let elements = &mut self.try_resizable(vm)?.elements;
606 let index = elements
607 .find_byte(value)
608 .ok_or_else(|| vm.new_value_error("value not found in bytearray"))?;
609 elements.remove(index);
610 Ok(())
611 }
612
613 #[pymethod]
614 fn extend(&self, object: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers 1

popMethod · 0.45

Calls 3

value_from_objectFunction · 0.85
try_resizableMethod · 0.80
ok_or_elseMethod · 0.80

Tested by

no test coverage detected