>>> class Test:
... def __init__(self, value):
... self.value = value
... def __lt__(self, other):
... print('lt')
... print(self.value)
... return self.value < other.value
...
>>> a = Test(10)
>>> b = Test(20)
>>> a < b
lt
10
True
>>> a > b
lt
20
False
>>>