a = [1, 2, 3, 1, 2, 3] b = [3, 2, 1, 3, 2, 1]
a & b should be considered equal, because they have exactly the same elements, only in different
If the comparison is to be performed in a testing context, use assertCountEqual(a, b) (py>=3.2) and assertItemsEqual(a, b) (2.7<=py<3.2).
py>=3.2
2.7<=py<3.2
Works on sequences of unhashable objects too.