On Apr 20, 2020, at 10:42, Ram Rachum <ram@rachum.com> wrote:
Here's something that would have saved me some debugging yesterday:
>>> zipped = zip(x, y, z, strict=True)
I suggest that `strict=True` would ensure that all the iterables have been exhausted, raising an exception otherwise.
One quick bikeshedding question (which also gets to the heart of how you’d want to implement it); apologies if this came up in the thread from 2 years ago or the discussion in the more-iterables PR that I just suggested everyone should read before commenting, but I wanted to get this down before I forget it. x = iter(range(5)) y = [0] try: zipped = zip(x, y, strict=True) except ValueError: # assuming that’s the exception you want? print(next(x)) Should this print 1 or 2 or raise StopIteration or be a don’t-care? Should it matter if you zip(y, x, strict=True) instead?