getting n items at a time from a generator

Neil Cerutti mr.cerutti at gmail.com
Sat Dec 29 07:17:05 EST 2007


On Dec 29, 2007 2:18 AM, Tim Roberts <timr at probo.com> wrote:

> Kugutsumen <kugutsumen at gmail.com> wrote:
> >
> >I am relatively new the python language and I am afraid to be missing
> >some clever construct or built-in way equivalent to my 'chunk'
> >generator below.
>
> I have to say that I have found this to be a surprisingly common need as
> well.  Would this be an appropriate construct to add to itertools?
>

Something similar is already contained in the itertools recipes page.

-- 
Neil Cerutti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071229/d5cec465/attachment.html>


More information about the Python-list mailing list