21 Apr
2020
21 Apr
'20
9:17 p.m.
On 04/21/2020 12:58 PM, David Mertz wrote:
it1 = iter([1,2,3]) it2 = iter([4,5]) it3 = iter([6,7,8, 9]) list(zip(it1, it2, it3)) [(1, 4, 6), (2, 5, 7)] next(it3) 8
[...] worse is that most versions being discussed here seem to consume the 8 from it3 before raising the exception [...] in my code it3 remains a perfectly good iterator that I can keep around to pull more values from.
it3 may be still usable, but it1 is not:
next(it1) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration
-- ~Ethan~