Combinatoric iterators are concerned with the enumeration, combination, and permutation of element sets:
- The product(*iterables, repeat=1) iterator produces a Cartesian product from the inputted iterable objects; it is essentially the same as using nested for loops in a generator. The nested loops cycle through the input iterables, with the rightmost element incrementing every iteration. The pattern returned is dependent upon the input; that is, if the input iterables are sorted, the output product tuples will be sorted as well.
It is important to point out that Cartesian products are not mathematical products; that is, they aren't the result of multiplication. They are actually part of analytic geometry and are all ...