1 3 package org.python.core; 4 5 11 public abstract class PyIterator extends PyObject { 12 public PyObject __iter__() { 13 return this; 14 } 15 16 public static PyString __doc__next = new PyString( 17 "x.next() -> the next value, or raise StopIteration" 18 ); 19 20 public PyObject next() { 21 PyObject ret = __iternext__(); 22 if (ret == null) 23 throw Py.StopIteration(""); 24 return ret; 25 } 26 27 public abstract PyObject __iternext__(); 28 } 29 | Popular Tags |