Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADT] Add
zip_equal
for iteratees of equal lengths
Add a new version of `zip` that assumes that all iteratees have equal lengths. The difference compared to `zip_first` is that `zip_equal` checks this assumption in builds with assertions enabled. This will allow us to clearly express the intent when working with equally-sized ranges without having to write this assertion manually. This is similar to Python's `zip(..., equal=True)` [1] or `more_itertools.zip_equal` [2]. I saw this first suggested by @benvanik. [1] https://peps.python.org/pep-0618/ [2] https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_equal Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D138865
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters