, , , float, decimal, , :
>>> from decimal import Decimal as D
>>> compare = lambda a, b: (a > b) - (a < b)
>>> def drange(start, stop, step):
relation = compare(stop, start)
if not relation:
raise ValueError('start and stop may not have the same value')
if compare(relation, 0) != compare(step, 0):
raise ValueError('step will not allow the sequence to finish')
while True:
yield start
start += step
if compare(stop, start) != relation:
break
>>> sequence = tuple(drange(D('70.390829'), D('70.855549'), D('0.001')))
>>> len(sequence)
465
, drange , :
>>> sequence = tuple(drange(70.390829, 70.855549, 0.001))
>>> len(sequence)
465