[Python-Dev] itertools.chain should take an iterable ?

Christos Georgiou tzot at mediconsa.com
Fri Sep 2 14:45:42 CEST 2005

"Paolino" <paolo_veronelli at libero.it> wrote in message 
news:431842AA.2050405 at libero.it...

> What if I want to chain an infinite list of iterables?
> Shouldn't itertools.chain be built to  handle that?

Raymond already suggested a four-line function that does exactly that.

Create your own personal-library modules containing the functions you find 
useful as building blocks, and when you have a large sw base using them, 
present your building blocks along with their use cases as arguments for 
inclusion in the standard library.

> I don't think it is a problem to accept only the second case you paste
> and produce TypeError on the others.

It would break compatibility with the current uses of itertools.chain .  I 
like it (and have used it) as it is. 

More information about the Python-Dev mailing list