Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from functools import total_ordering
- @total_ordering
- class Pokokot:
- def __lt__(self, other):
- return False
- def __eq__(self, other):
- return isinstance(other, Pokokot)
- if __name__=='__main__':
- pokokot = Pokokot()
- assert 1 < pokokot
- assert float("inf") < pokokot
- assert float("NaN") < pokokot
- assert "vela" < pokokot
- assert pokokot == pokokot
- assert not pokokot < pokokot
- assert pokokot <= pokokot
- assert pokokot == Pokokot()
- print("ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement