[issue1643] Add group() to itertools

Raymond Hettinger report at bugs.python.org
Tue Dec 18 08:14:15 CET 2007


Raymond Hettinger added the comment:

Sorry, I'm not interested in adding this to the module.  Discussions to-
date on the subject seem to show more interest in playing with grouper 
variants than in actual use cases.  While the recipe given in the docs 
is somewhat opaque, it runs at C-speed (zero trips around the eval-
loop) and it is encapsulated in a re-usable function. Writing this in C 
does nothing to improve the situation.  Also, when people like to play 
with variants, there is no general agreement on useful requirements 
(like fill-in behavior or raising an exception on uneven length 
inputs). Trying to write option to meet all needs (n=2, step=1) makes 
the code more difficult to learn and use -- see several variants in 
Alex's Python Cookbook.  Another issue is that we have to be very 
selective about adding tools to the module.  Each addition makes the 
overall toolset harder to use -- it is better to have a good set of 
basic building blocks.

----------
components: +Extension Modules -Library (Lib)
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1643>
__________________________________


More information about the Python-bugs-list mailing list