Tim Peters added the comment:
Lucas, I largely agree, but it is documented that the various combinatorial
generators emit items in a particular lexicographic order. So that is
documented, and programs definitely rely on it.
That's why, in an earlier comment, Terry suggested that perhaps `product()`
could make a special case of its (and only its) first argument (and only when
repeat=1). Each element of the first iterable is needed only once (although it
may copied into any number of outputs), so there's no actual need to make a
tuple of it first. The implementation is just simpler and clearer by treating
all arguments alike.
Which is a good enough reason for me - and the "use cases" for an unbounded
first argument look exceptionally weak to me.
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list