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)
| 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 | |
| 102 | impl<T> TryFromObject for ArgIterable<T> |