[Python-ideas] Add 'interleave' function to itertools?

Antoine Pitrou solipsis at pitrou.net
Thu Aug 8 15:47:06 CEST 2013


Le Thu, 8 Aug 2013 15:28:15 +0200,
Masklinn <masklinn at masklinn.net> a écrit :
> On 2013-08-08, at 06:01 , Stefan Behnel wrote:
> 
> > MRAB, 07.08.2013 22:12:
> >> And are these functions worthy of inclusion in itertools? :-)
> > 
> > The fact that they are a short construction of the existing tools
> > indicates that they are better suited for the recipes section than
> > the itertools functions section of the module docs. There is
> > already a roundrobin() recipe.
> 
> I'm really not fond at all of the "recipes" section, at least under
> its current incarnation: it's nice to have examples of composing
> itertools functions to build more specialized or higher-level tools,
> but recipes functions should be available in itertools or a
> submodule: the work has been done already, it's wasteful and annoying
> to have to copy/paste these functions to some arbitrary location
> every time they are needed, that's what libraries are for.

I agree with this, plus there's always the risk of making a mistake
when pasting them, and unit tests are not included.

Regards

Antoine.




More information about the Python-ideas mailing list