I\'d like to cycle through a list repeatedly (N times) via an iterator, so as not to actually store N copies of the list in memory. Is there a built-in or elegant way to do
import itertools itertools.chain.from_iterable(itertools.repeat([1, 2, 3], 5))
Itertools is a wonderful library. :)