[issue30738] __next__() method in iterators 9.9

2017-06-22 Thread Eryk Sun
Eryk Sun added the comment: Did you try the example in Python 2? Did you click on the "next" link in the preceding paragraph? Please read the following: https://docs.python.org/2/library/stdtypes.html#iterator.next iterator.next() Return the next item from the container In

[issue30738] __next__() method in iterators 9.9

2017-06-22 Thread Hiba
New submission from Hiba: class Reverse: """Iterator for looping over a sequence backwards.""" def __init__(self, data): self.data = data self.index = len(data) def __iter__(self): return self def next(self): if self.index == 0: raise