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~
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/Q64YKH4SF4RY3GWMZCBQVGQTU7ZNKD7N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to