one-shot iterator class Simple def next return i-1 def __iter__ return

1
2
3
4
5
6
7
#one-shot iterator
class Simple:
def next():
...
return (l[i-1], l[i])
def __iter__():
return self