A question about class as an iterator

Yaşar Arabacı yasar11732 at gmail.com
Sun Aug 28 13:22:08 EDT 2011


I got confused about classes as an iterator. I saw something like this:

class foo():
        return 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110828/3e1d0b5b/attachment.html>

More information about the Python-list mailing list