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

Method iter

crates/vm/src/function/protocol.rs:93–99  ·  view source on GitHub ↗

Returns an iterator over this sequence of objects. This operation may fail if an exception is raised while invoking the `__iter__` method of the iterable object.

(&self, vm: &'a VirtualMachine)

Source from the content-addressed store, hash-verified

91 /// This operation may fail if an exception is raised while invoking the
92 /// `__iter__` method of the iterable object.
93 pub fn iter<'a>(&self, vm: &'a VirtualMachine) -> PyResult<PyIterIter<'a, T>> {
94 let iter = PyIter::new(match self.iter_fn {
95 Some(f) => f(self.iterable.clone(), vm)?,
96 None => PySequenceIterator::new(self.iterable.clone(), vm)?.into_pyobject(vm),
97 });
98 iter.into_iter(vm)
99 }
100}
101
102impl<T> TryFromObject for ArgIterable<T>

Callers 1

into_iterMethod · 0.45

Calls 5

newFunction · 0.85
fFunction · 0.50
cloneMethod · 0.45
into_pyobjectMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected