I have a generator, what is the most pythonic way to get its output placed in lists of N elements?
For instance, in the code:
>>> the_splitter(xrange(11).__iter__(), 3)
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10]]
i want the definition of the_splitter()
function.