On Thu, Jan 23, 2014 at 7:05 AM, eryksun <eryk...@gmail.com> wrote: > 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.
I'm now realizing I don't understand this comment at all. First, there IS a __iter__ method in the example: does the presence of such make it a generator already, or is it a usage thing, or something else? I don't yet completely understand the difference/point... or maybe you mean inherit the generator class? Second: you state that I don't have to worry about the name difference, but when I changed the method name from next to __next__ it worked in 3.3. So what's your point here? I'm just realizing I'm missing your pearls of wisdom, not intending on being combative or something. -- Keith _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor