I have a class MyClass that contains two member variables foo and bar.
I have two instances of this class, each of which has the same values for foo and bar.
However, when I compare them for equality, Python returns False.
How can I guarantee that these objects are equal, without having to manually check the values of their attributes every time they are compared? For example, I would like to be able to use the "in" operator.
source
share