for subrange, batch in batched(records, size=1000):
print("Processing records %d-%d" %(subrange[0], subrange[-1]))
process(batch)
我试过这样做:
def myfunc(batched):
for subrange, batch in batched(records, size=1000):
print("Processing records %d-%d" %
(subrange[0], subrange[-1]))
yield(batched)