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


Groups > comp.lang.python > #44579

Why chunks is not part of the python standard lib?

Date 2013-05-01 01:26 -0500
Subject Why chunks is not part of the python standard lib?
From Ricardo Azpeitia Pimentel <razpeitia@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1207.1367389575.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Why chunks is not part of the python standard lib? Ricardo Azpeitia Pimentel <razpeitia@gmail.com> - 2013-05-01 01:26 -0500

csiph-web