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.
This is definitely sometimes useful, but I think less often than zip_longest, which we already decided long ago isn’t important enough to push into zip but instead should be a separate function living in itertools. I’ll bet there’s a zip_strict (or some other name for the same idea) in the more-itertools library. (If not, it’s probably worth submitting.) Whether it’s important enough to bring into itertools, add as a recipe, or call out as an example of what more-itertools can do in the itertools docs, I’m not sure. But I don’t think it needs to be added as a flag on the builtin.