On 8/15/2013 4:16 PM, Eric V. Smith wrote:
itertools.chain.from_iterable. But I think that was a mistake, too. As a recent discussion showed, it's not exactly discoverable. The fact that it's not mentioned in the list of functions at the top of the documentation doesn't help. And "chain" is documented as a "module function", and "chain.from_iterable" as a "classmethod" making it all the more confusing.
I think itertools.combinations and itertools.combinations_with_replacement is the better example of related functions that should be followed. Not nested, no special parameters trying to differentiate them: just two different function names.
Great implied idea. I opened http://bugs.python.org/issue18752 "Make chain.from_iterable an alias for a new chain_iterable."