[Python-ideas] itertools.chunks(iterable, size, fill=None)
Stefan Behnel
stefan_ml at behnel.de
Sun Jul 1 07:44:56 CEST 2012
Terry Reedy, 30.06.2012 23:09:
> For the doc, I think it would be helpful here and in most module
> subchapters if there were a subchapter table of contents at the top (under
> 9.1 in this case). Even though just 2 lines here (currently, but see
> below), it would let people know that there *is* a recipes section. After
> the appropriate tables, mention that there are example uses in the recipe
> section. Possibly add similar tables in the recipe section.
+1, the recipes are interesting enough to be highly visible, both as usage
examples and to solve actual problems.
> Another addition could be a new subsection on grouping (chunking) that
> would discuss post-processing of grouper (as discussed above), as well as
> other recipes, including ones specific to strings and sequences. It would
> essentially be a short how-to. Call it 9.1.3 "Grouping, Blocking, or
> Chunking Sequences and Iterables". The synonyms will help external
> searching. A toc would let people who have found this doc know to look for
> this at the bottom.
If it really is such an important use case for so many people, I agree that
it's worth special casing it in the docs. It's not a trivial algorithmic
step from a sequential iterable to a grouped iterable.
Stefan
More information about the Python-ideas
mailing list