That is not the expected behavior of iterators.
>>> x = iter(range(5)) >>> list(x) [0, 1, 2, 3, 4] >>> list(x) [] >>> list(x) []
That is not the expected behavior of iterators.
>>> x = iter(range(5))
>>> list(x)
[0, 1, 2, 3, 4]
>>> list(x)
[]
>>> list(x)
[]