Add a zip helper that stops at the shortest input
Author: apstndbCreated May 3, 2026Updated May 23, 2026
Labelsbreaking change
it.ZipBy2 currently pads missing values with zero values when inputs have different lengths.
In some cases, a helper that stops as soon as either input is exhausted is safer and more useful. This matches the common “zip shortest” behavior used in many other languages and iterator libraries.
Proposal
Add a new helper in lo/it with “shortest input wins” semantics, for example:
ZipShortestBy2ZipShortBy2ZipBy2Shortest
Expected behavior
The helper should yield values only while both input sequences still have elements, and stop when either side ends.
This would help avoid subtle bugs caused by zero-value padding when input lengths differ.
Source: samber/lo