def cycle(coll):
    """
    Returns a (infinite!) generator which yields repetitions of the items in
    ``coll``.
    """
    els = []
    for e in coll:
        yield e
        els.append(e)
    while True:
        for e in els:
            yield e
