Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from functools import total_ordering
  2.  
  3. @total_ordering
  4. class Pokokot:
  5.     def __lt__(self, other):
  6.         return False
  7.  
  8.     def __eq__(self, other):
  9.         return isinstance(other, Pokokot)
  10.  
  11. if __name__=='__main__':
  12.     pokokot = Pokokot()
  13.     assert 1 < pokokot
  14.     assert float("inf") < pokokot
  15.     assert float("NaN") < pokokot
  16.     assert "vela" < pokokot
  17.     assert pokokot == pokokot
  18.     assert not pokokot < pokokot
  19.     assert pokokot <= pokokot
  20.     assert pokokot == Pokokot()
  21.     print("ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement