Raymond Hettinger added the comment:
These have been rejected before. There is always a trade-off in adding tools
such as this -- it can take more time to learn and remember them than to write
a trivial piece of code to do it yourself. Another issue is that people tend
to disagree on how to
Cal Leeming added the comment:
Oh - and while we are at it - how about having merge_list() and unique_list()
as part of the core too??
def unique_list(seq): # Dave Kirby
# Order preserving
seen = set()
return [x for x in seq if x not in seen and not seen.add(x)]
def merge_lis
Ezio Melotti added the comment:
This sounds like the grouper() recipe of itertools. You could try to convince
Raymond and see if he wants to include it in itertools.
--
nosy: +ezio.melotti, rhettinger
versions: +Python 3.3
___
Python tracker
New submission from Cal Leeming :
After a while of digging around, I noticed that the core libs don't provide an
easy way of splitting a list/tuple into chunks - as per the following
discussion:
http://www.aspwinhost.com/In-what-way-do-you-split-an-list-into-evenly-sized-chunks-on-Python/
The