"""self == other"""
raise NotImplementedError
- # __ne__ is inherited from object and negates whatever __eq__ does.
+ def __ne__(self, other):
+ """self != other"""
+ # The default __ne__ doesn't negate __eq__ until 3.0.
+ return not (self == other)
Complex.register(complex)
self.assertFalse(R(2, 3) <= R(1, 2))
self.assertTrue(R(1, 2) == R(1, 2))
self.assertFalse(R(1, 2) == R(1, 3))
+ self.assertFalse(R(1, 2) != R(1, 2))
+ self.assertTrue(R(1, 2) != R(1, 3))
def testMixedLess(self):
self.assertTrue(2 < R(5, 2))