(&self, f: F)
| 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 | |
| 156 | pub fn builtins_iter(vm: &VirtualMachine) -> PyObjectRef { |