For your (and my) records: itertools.repeat() does the same thing while requiring a constant amount of memory. Probably useless here.