[Python-ideas] Looking for a "batch" function

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jul 18 03:31:53 CEST 2010


Shane Hathaway wrote:

> - It ignores the type of the container.  If I provide a string as input, 
> I expect an iterable of strings as output.

Fine, but...

> - If I give a batch size of 1000000, grouper() is going to be rather 
> inefficient.

I guess you would prefer each batch to be a lazy iterator
over part of the original sequence -- but that would conflict
with the previous requirement.

-- 
Greg



More information about the Python-ideas mailing list