How can I use
itertools.combinations_with_replacement
by leaving out some particular type of combinations. In the case
list(combinations_with_replacement([1, 2, 3, 4], 3))
I need to avoid (1,1,1), (2,2,2), (3,3,3), (4,4,4) by leaving all the rest. Here is a good reference, but I could not find what I need.