On 8/28/2011 1:22 PM, Yaşar Arabacı wrote:
I got confused about classes as an iterator. I saw something like this:
class foo():
__iter__(self):
return self
next(self):
return something
2.x
But then I saw a __next__ method on some code.
3.x
This might work in 2.
Hi,
I got confused about classes as an iterator. I saw something like this:
class foo():
__iter__(self):
return self
next(self):
return something
But then I saw a __next__ method on some code. So what is the deal, which
one should I use and what is the difference?
--
ht