def genrange(*a):
 (start, stop, step) = handleargs(a)
 value = start
 while (value < stop):
  (yield value)
  value += step

def genrange ( * a ) : ( start , stop , step ) = handleargs ( a ) value = start while ( value < stop ) : ( yield value ) value += step
function to implement range as a generator .