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

Method length_hint

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

Source from the content-addressed store, hash-verified

130 }
131
132 pub fn length_hint<F>(&self, f: F) -> usize
133 where
134 F: FnOnce(&T) -> usize,
135 {
136 if let IterStatus::Active(obj) = &self.status {
137 f(obj).saturating_sub(self.position)
138 } else {
139 0
140 }
141 }
142
143 pub fn rev_length_hint<F>(&self, f: F) -> usize
144 where

Callers 13

test_length_hintMethod · 0.45
test_lenMethod · 0.45
test_repeatMethod · 0.45
length_hintFunction · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45
__length_hint__Method · 0.45

Calls 1

fFunction · 0.50

Tested by 4

test_length_hintMethod · 0.36
test_lenMethod · 0.36
test_repeatMethod · 0.36