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

Method pop

crates/vm/src/builtins/bytearray.rs:578–584  ·  view source on GitHub ↗
(&self, index: OptionalArg<isize>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

576
577 #[pymethod]
578 fn pop(&self, index: OptionalArg<isize>, vm: &VirtualMachine) -> PyResult<u8> {
579 let elements = &mut self.try_resizable(vm)?.elements;
580 let index = elements
581 .wrap_index(index.unwrap_or(-1))
582 .ok_or_else(|| vm.new_index_error("index out of range"))?;
583 Ok(elements.remove(index))
584 }
585
586 #[pymethod]
587 fn insert(&self, index: isize, object: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 4

try_resizableMethod · 0.80
ok_or_elseMethod · 0.80
wrap_indexMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected