Christos Georgiou wrote: > "Paolino" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>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.
I see ,I just thought itertools was young and important enough to be investigated and eventually changed, but probably this is not the place to talk about that.I will submit the feature request to SF. I must add that the inverse story would have been def handy_chain(*args): return itertools.chain(iter(args)) a two-line function (ex lambda). Generally speaking, having a star-signature in a base library function is not a good choice. This is a proof of a case. Thanks all and have a nice summer. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com