def gRange(start=0,step=1,stop=None):
    """Generalized version of range() - could be infinite
    
    Note the difference in the order of arguments from those
    of range().
    
    """
    if stop is None:
        x = int(start)
        step = int(step)
        while 1:
            yield x
            x += step
    else:
        for x in range(start, stop, step):
            yield x
Generalized version of range() - could be infinite
    
    Note the difference in the order of arguments from those
    of range().
    
    
recipes/Python/170995_Manipulating_infinite_lists_implemented/recipe-170995.py