def aritprog_gen(begin, step, end=None):
    result = type(begin + step)(begin)
    forever = end is None
    index = 0
    while forever or result < end:
        yield result
        index += 1
        result = begin + step * index
# END ARITPROG_GENFUNC
dataset/ETHPy150Open fluentpython/example-code/14-it-generator/aritprog_v2.py/aritprog_gen/original