I’ve found that when I use
iter.zip() it’s almost always to iterate over same-length arrays.
Unfortunately, when I don’t intend any of the iterators to be shorter or empty,
.zip()'s graceful handing of different lengths hides and propagates errors.
I think it would be good for code robustness if the expectation of iterators being same length could be made explicit and enforced (like
.zip() gets awkward quickly when iterating more than two iterators. So perhaps both problems could be solved by deprecating zip and adding an alternative, more convenient solution. Something that assumes same lengths by default (for varying-length iterators there should be a separate function, e…g
zip_shortest) and easily supports more than two iterators?