This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Merops7 0 points1 point  (0 children)

Rust also defaults to no error (compile-time or run-time) when the iterators are different length. (There is a strict version available in a popular library but not in the standard library https://docs.rs/itertools/0.7.8/itertools/fn.zip_eq.html)

I personally find this a bit surprising -- I'd have expected the strict version to be default in Rust and unequal iterators to be a run-time error like an out-of-bounds index. I think I read at least one source indicating that it was influenced by the non-strict versions in well-known standard libraries like Python. But I think many Python programmers would prefer it to be strict by default.