'No default delegation between operations except __ne__()'

def test_other_delegation(self):

    ops = (('__eq__', (lambda a, b: (a == b))), ('__lt__', (lambda a, b: (a < b))), ('__le__', (lambda a, b: (a <= b))), ('__gt__', (lambda a, b: (a > b))), ('__ge__', (lambda a, b: (a >= b))))
    for (name, func) in ops:
        with self.subTest(name):
            def unexpected(*args):
                self.fail('Unexpected    operator    method    called')
            class C:
                __ne__ = unexpected
            for (other, _) in ops:
                if (other != name):
                    setattr(C, other, unexpected)
            if (name == '__eq__'):
                self.assertIs(func(C(), object()), False)
            else:
                self.assertRaises(TypeError, func, C(), object())
