| 43 | |
| 44 | |
| 45 | class Infinity: |
| 46 | def __repr__(self): |
| 47 | return "Infinity" |
| 48 | |
| 49 | def __hash__(self): |
| 50 | return hash(repr(self)) |
| 51 | |
| 52 | def __lt__(self, other): |
| 53 | return False |
| 54 | |
| 55 | def __le__(self, other): |
| 56 | return False |
| 57 | |
| 58 | def __eq__(self, other): |
| 59 | return isinstance(other, self.__class__) |
| 60 | |
| 61 | def __ne__(self, other): |
| 62 | return not isinstance(other, self.__class__) |
| 63 | |
| 64 | def __gt__(self, other): |
| 65 | return True |
| 66 | |
| 67 | def __ge__(self, other): |
| 68 | return True |
| 69 | |
| 70 | def __neg__(self): |
| 71 | return NegativeInfinity |
| 72 | |
| 73 | |
| 74 | Infinity = Infinity() |