Remove duplicates in list of object with Python

The set(list_of_objects) will only remove the duplicates if you know what a duplicate is, that is, you’ll need to define a uniqueness of an object. In order to do that, you’ll need to make the object hashable. You need to define both __hash__ and __eq__ method, here is how: http://docs.python.org/glossary.html#term-hashable Though, you’ll probably only need … Read more