MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / __lt__

Method __lt__

Solutions/2_4/mutint.py:56–62  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

54
55 # One relation is needed for @total_ordering decorator. It fills in others
56 def __lt__(self, other):
57 if isinstance(other, MutInt):
58 return self.value < other.value
59 elif isinstance(other, int):
60 return self.value < other
61 else:
62 return NotImplemented
63
64 # Conversions to int() and float()
65 def __int__(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected