Iteratoration question

andrew cooke andrew at acooke.org
Fri Apr 3 01:41:44 CEST 2009


Robert Kern wrote:
>> replace return with yield and it might work.
>>
>> i have to go eat, but if it doesn't read the python docs on iterators -
>> for example http://docs.python.org/reference/expressions.html#index-1825
>
> No, .next() needs to be a regular function that returns a value. What he
> needs
> is an __iter__() method that returns self. Alternately, __iter__ could be

yeah, sorry, i was in a rush and not thinking straight.  andrew




More information about the Python-list mailing list