Although the name can be interpreted as three questions, the actual problem is easy to describe. On Linux, I have python 2.7.3 installed and you want to be warned about python 3 incompatibility. So my code snippet ( tester.py) looks like this:
class MyClass(object):
def __eq__(self, other):
return False
When I execute this piece of code (I think that it should only show the problem, and not the actual piece of code that I use in my project) as
./tester.py
I get the following failure warning:
./tester.py:3: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
class MyClass(object):
My question is: how do I change this piece of code to get rid of the warning, i.e. make it compatible with version 3? I want to implement the equality operator correctly, and not just suppress a warning or something like that.