The command permutation from itertools
permutations([0,1,1])
returns
(0, 1, 1), (0, 1, 1), (1, 0, 1), (1, 1, 0), (1, 0, 1), (1, 1, 0)
is there a way to return
(0,1,1), (1,0,1), (1,1,0)
that is, for an arbitrary list of integers get all permutations, but without repeated elements if elements in the original list repeat?