flying sheep added the comment: To elaborate more on my second point (“No reentrant iterables are necessary here, only iterables with a __len__”)
What i meant here is that inside a call of chain(*iterables), such as chain(foo, bar, *baz_generator()), the paramter “iterables” is always a tuple, i.e. a sequence. So it is always possible to just call len() on each element of “iterables” and either get a ValueError or a collection of summable integers. With other itertools functions, we’d need to determine beforehand if we have reentrant iterables or not. This might be a problem, and for some too un-lazy (e.g. groupby) But at the very very least, we could implement this for everything where i didn’t write “(r)”: map, accumulate, chain, islice, starmap, tee, product, permutations, combinations, combinations_with_replacement ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24849> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com