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

Method __reversed__

crates/vm/src/builtins/list.rs:265–270  ·  view source on GitHub ↗
(zelf: PyRef<Self>)

Source from the content-addressed store, hash-verified

263
264 #[pymethod]
265 fn __reversed__(zelf: PyRef<Self>) -> PyListReverseIterator {
266 let position = zelf.__len__().saturating_sub(1);
267 PyListReverseIterator {
268 internal: PyMutex::new(PositionIterInternal::new(zelf, position)),
269 }
270 }
271
272 fn _getitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult {
273 match SequenceIndex::try_from_borrowed_object(vm, needle, "list")? {

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
__len__Method · 0.45

Tested by

no test coverage detected