Fix Python – Should __ne__ be implemented as the negation of __eq__?
I have a class where I want to override the __eq__ method. It seems to make sense that I should override the __ne__ method as well. Should I implement __ne__ as the negation of __eq__ as such or is it a bad idea?
class A:
def __init__(self, state):
self.state = state
def __eq__(self, other):
return self.state == other.sta….