On 9 Dec 2013 01:47, "Chris Angelico" <rosuav@gmail.com> wrote:
>
> On Mon, Dec 9, 2013 at 2:40 AM, Ron Adam <ron3200@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.

tee() is this building block.

Cheers,
Nick.

>
> ChrisA
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/