Though more-itertools contains many functions, it can never be 'complete'.
Below extensions were or could be proposed, but not (yet) added to more-itertools.
Module more-more-itertools acts as their abode until they get added to more-itertools.
Lazely iterate over product of *iterables (potentially with repeat), which can be unbounded,
differentiating lazy_product from stdlib itertool.product.
- Still #TODO
Lazely iterate over product of *iterables (potentially with repeat), which can be unbounded,
in a 'diagonal' fashion.
- Still #TODO
at_least_n(iterable, /, n, *, too_short=None)
Iterate over iterable and validate it has at least n items.
If it has fewer than n items, call function too_short with its item-count.
- Suggested for addition to
more-itertoolsas #1053 on 9 Aug 2025.
at_most_n(iterable, /, n, *, too_long=None)
Iterate over the first ≤n items of iterable and validate it has at most n items (i.e. is exhausted then).
If it has more than n items, call function too_long with the number n + 1.
Even if too_long doesn't raise, the remaining items (>n) get skipped.
- Suggested for addition to
more-itertoolsas #1053 on 9 Aug 2025.
throttle(iterable, /, *, min_step) or throttle(iterable, /, *, max_rate)
Iterate over iterable at (potentially slowed-down) pace of at least min_step sec per item,
or at most max_rate items per sec.
timeout(iterable, /, max_time, *, exception=TimeoutError)
Iterate over iterable with potential premature stop after a timeout of max_time sec.
If iterable takes longer than max_time sec, i.e. a timeout occurs, exception is raised if not None.
For a timeout with exception None, iteration stops without exception
(cf. itertools.islice(), but after certain duration instead of certain count).