Why chunks is not part of the python standard lib?

  • Thread starter Ricardo Azpeitia Pimentel
  • Start date
R

Ricardo Azpeitia Pimentel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top