It is universally agreed that a list of n distinct symbols has n! permutations. However, when the symbols are not distinct, the most common convention, in mathemati
Revisiting this old question, the easiest thing to do now is to use more_itertools.distinct_permutations.