itertools
itertools copied to clipboard
Add `cycle_n` iterator
Same as cycle but with finite number of repeats.
Can we say that we already cover this with itertools::repeat_n(iter, n).flatten()?
Microbenchmarks say dedicated function will get optimized better.
And, personally, I would prefer being able to do this with only dot-chaining