01: package org.python.core;
02:
03: public class PySequenceIter extends PyIterator {
04: private PyObject seq;
05: private int idx;
06:
07: public PySequenceIter(PyObject seq) {
08: this .seq = seq;
09: this .idx = 0;
10: }
11:
12: public PyObject __iternext__() {
13: try {
14: return seq.__finditem__(idx++);
15: } catch (PyException exc) {
16: if (Py.matchException(exc, Py.StopIteration))
17: return null;
18: throw exc;
19: }
20: }
21:
22: }
|