Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44580 > unrolled thread

Re: Why chunks is not part of the python standard lib?

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2013-05-01 08:10 +0100
Last post2013-05-01 08:10 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Why chunks is not part of the python standard lib? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-01 08:10 +0100

#44580 — Re: Why chunks is not part of the python standard lib?

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-05-01 08:10 +0100
SubjectRe: Why chunks is not part of the python standard lib?
Message-ID<mailman.1208.1367392233.3114.python-list@python.org>
On 01/05/2013 07:26, Ricardo Azpeitia Pimentel wrote:
> After reading How do you split a list into evenly sized chunks in
> Python?
> <http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python>
> and seeing this kind of mistakes happening
> https://code.djangoproject.com/ticket/18972 all the time.
>
> Why is not a |chunks| function in itertools?
>
> |grouper| from
> http://docs.python.org/2/library/itertools.html#recipes doesn't have the
> same behavior as |chunks |
>
> Example:
> |
>
> |chunks([1,  2,  3,  4,  5],  3)
> # Should return [[1, 2, 3], [4, 5]] or the iterator equivalent.|
>
> |Original Post on StackOverflow:
> http://stackoverflow.com/questions/16313008/why-chunks-is-not-part-of-the-python-standard-lib
>
>

Asked and answered a trillion times.  There's no concensus on how chucks 
should behave.

-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web