Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6021
___
___
Python-bugs-list
New submission from Lie Ryan lie.1...@gmail.com:
An itertool to Group-by-n
lst = range(15)
itertools.grouper(lst, 5)
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]
This function is often asked in several c.l.py discussions, such as these:
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
This has been rejected before.
* It is not a fundamental itertool primitive. The recipes section in
the docs shows a clean, fast implementation derived from zip_longest().
* There is some debate on a correct API for odd
Lie Ryan lie.1...@gmail.com added the comment:
All implementations relying on zip or zip_longest breaks with infinite
iterable (e.g. itertools.count()).
And it is not impossible to define a clean, flexible, and familiar API
which will be similar to open()'s mode or unicode error mode. The modes
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
All implementations relying on zip or zip_longest breaks
with infinite iterable (e.g. itertools.count()).
How is it broken?
Infinite in, infinite out.
def grouper(n, iterable, fillvalue=None):
...args =
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6021
___
___
Python-bugs-list