I stumpled into a problem of understanding the decorators. Compared to the code below, what is the use of the __lt__(self, number)
method compared to the less_than(self, number)
method?
Is there any difference between the two methods and how they handle the arguments?
class Sort:
def __init__(self, number):
self.number = number
def __lt__(self, number):
return self.number < number
def less_than(self, number):
return self.number < number