def list_step(max = 268):
""" split in steps of 120 elements at time
"""
if max > 120:
for i in xrange(0,max,120):
if i <= max:
rest = max % xrange(0,max,120)[-1]
if rest != 120:
yield(i, rest)
else:
yield(i, 0)
else:
yield(max)
a = list_step()
a.next() return > (0,28) (120,28),ecc
残りのタプルの代わりに、最後の next() の実行時に残りを返すことは可能でしょうか?
となることによって :
a.next() return > (0) (120),ecc.. (28)