def __eq__(self, other):
if isinstance(other, type(self)):
for attr in ('_name', '_value', '_invert', '_op'):
if getattr(self, attr) != getattr(other, attr):
return False
return True
else:
return NotImplemented