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

Method rev_length_hint

crates/vm/src/builtins/iter.rs:143–153  ·  view source on GitHub ↗
(&self, f: F)

Source from the content-addressed store, hash-verified

141 }
142
143 pub fn rev_length_hint<F>(&self, f: F) -> usize
144 where
145 F: FnOnce(&T) -> usize,
146 {
147 if let IterStatus::Active(obj) = &self.status
148 && self.position <= f(obj)
149 {
150 return self.position + 1;
151 }
152 0
153 }
154}
155
156pub fn builtins_iter(vm: &VirtualMachine) -> PyObjectRef {

Callers 1

__length_hint__Method · 0.80

Calls 1

fFunction · 0.50

Tested by

no test coverage detected