def repeatedly(f, n=EMPTY):
    """Takes a function of no args, presumably with side effects,
       and returns an infinite (or length n) iterator of calls to it."""
    _repeat = repeat(None) if n is EMPTY else repeat(None, n)
    return (f() for _ in _repeat)
Takes a function of no args, presumably with side effects,
       and returns an infinite (or length n) iterator of calls to it.
funcy/seqs.py