[Tutor] iter class

eryksun eryksun at gmail.com
Thu Jan 23 13:05:19 CET 2014


On Thu, Jan 23, 2014 at 12:53 AM, Keith Winston <keithwins at gmail.com> wrote:
>> in Python 3, it should be __next__, not next.
>
> Ah! That's it! Thanks!!!

Generally you'll make `__iter__` a generator, so you don't have to
worry about implementing `__next__`. Also, the built-in function
`next` was added in 2.6, so you don't have to worry about the method
name difference between 2.x and 3.x, either.


More information about the Tutor mailing list