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

Masklinn masklinn at masklinn.net
Thu Aug 8 15:28:15 CEST 2013


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.

At least there's more_itertools on pypy, but I think one should not need
a third-party package for things functions which are defined (though not
useable) in the standard library itself.


More information about the Python-ideas mailing list