Simple code:
>>> set([2,2,1,2,2,2,3,3,5,1])
set([1, 2, 3, 5])
Ok, in the resulting sets there are no duplicates. What if the object in the list are not int but are some defined by me? What method does it check to understand if they are different? I implemented __eq__ and __cmp__ with some objects but set doesn't seems to use them :\
Does anyone know how to solve this?