On Apr 20, 2020, at 10:42, Ram Rachum <r...@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. _______________________________________________ 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/QKU65L2QIEKUOABDAF6QCBJ3AKSXOHWG/ Code of Conduct: http://python.org/psf/codeofconduct/