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

Method pop

crates/stdlib/src/array.rs:917–924  ·  view source on GitHub ↗
(zelf: &Py<Self>, i: OptionalArg<isize>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

915
916 #[pymethod]
917 fn pop(zelf: &Py<Self>, i: OptionalArg<isize>, vm: &VirtualMachine) -> PyResult {
918 let mut w = zelf.try_resizable(vm)?;
919 if w.len() == 0 {
920 Err(vm.new_index_error("pop from empty array"))
921 } else {
922 w.pop(i.unwrap_or(-1), vm)
923 }
924 }
925
926 #[pymethod]
927 pub(crate) fn tobytes(&self) -> Vec<u8> {

Callers 3

groupMethod · 0.45
from_argsMethod · 0.45
emit_next_tokenFunction · 0.45

Calls 3

try_resizableMethod · 0.80
ErrClass · 0.50
lenMethod · 0.45

Tested by

no test coverage detected