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

Method next

crates/vm/src/builtins/list.rs:728–733  ·  view source on GitHub ↗
(zelf: &Py<Self>, _vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

726impl SelfIter for PyListIterator {}
727impl IterNext for PyListIterator {
728 fn next(zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<PyIterReturn> {
729 zelf.internal.lock().next(|list, pos| {
730 let vec = list.borrow_vec();
731 Ok(PyIterReturn::from_result(vec.get(pos).cloned().ok_or(None)))
732 })
733 }
734}
735
736#[pyclass(module = false, name = "list_reverseiterator", traverse)]

Callers 1

fast_nextMethod · 0.45

Calls 4

borrow_vecMethod · 0.80
rev_nextMethod · 0.80
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected