[issue6021] itertools.grouper

2012-06-29 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6021 ___ ___ Python-bugs-list

[issue6021] itertools.grouper

2009-05-14 Thread Lie Ryan
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:

[issue6021] itertools.grouper

2009-05-14 Thread Raymond Hettinger
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

[issue6021] itertools.grouper

2009-05-14 Thread Lie Ryan
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

[issue6021] itertools.grouper

2009-05-14 Thread Raymond Hettinger
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 =

[issue6021] itertools.grouper

2009-05-14 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6021 ___ ___ Python-bugs-list