Every use I can think of for Python\'s itertools.repeat() class, I can think of another equally (possibly more) acceptable solution to achieve the same effect. For example:<
I usually use repeat in conjunction with chain and cycle. Here is an example:
from itertools import chain,repeat,cycle
fruits = ['apples', 'oranges', 'bananas', 'pineapples','grapes',"berries"]
inventory = list(zip(fruits, chain(repeat(10,2),cycle(range(1,3)))))
print inventory
Puts the first 2 fruits as value 10, then it cycles the values 1 and 2 for the remaining fruits.