示例#1
0
def repeat(item, count=None):
    if count is None:
        while True:
            yield item
    else:
        for i in compatible.irange(count):
            yield item
示例#2
0
def range(*args):
    s = slice(*args)
    return iter(compatible.irange(s.start or 0, s.stop or sys.maxsize, s.step or 1))