[Python-ideas] Batching/grouping function for itertools

Chris Angelico rosuav at gmail.com
Sun Dec 8 16:46:53 CET 2013


On Mon, Dec 9, 2013 at 2:40 AM, Ron Adam <ron3200 at gmail.com> wrote:
> The function would need to be a wrapper that keeps a buffer.  And the front
> of the buffer would always be the next to be yielded if there is anything in
> it.

Which is what Stephen said in his pithy message above. Yes, it's
theoretically possible, but it's not something to do in the general
case. Not something to depend on for a chunker/grouper, which should
be able to pass once over the underlying iterator.

ChrisA


More information about the Python-ideas mailing list