Aluode/PerceptionLabPortable
0
1# This file is dual licensed under the terms of the Apache License, Version2# 2.0, and the BSD License. See the LICENSE file in the root of this repository3# for complete details.4 5 6class InfinityType:7 def __repr__(self) -> str:8 return "Infinity"9 10 def __hash__(self) -> int:11 return hash(repr(self))12 13 def __lt__(self, other: object) -> bool:14 return False15 16 def __le__(self, other: object) -> bool:17 return False18 19 def __eq__(self, other: object) -> bool:20 return isinstance(other, self.__class__)21 22 def __gt__(self, other: object) -> bool:23 return True24 25 def __ge__(self, other: object) -> bool:26 return True27 28 def __neg__(self: object) -> "NegativeInfinityType":29 return NegativeInfinity30 31 32Infinity = InfinityType()33 34 35class NegativeInfinityType:36 def __repr__(self) -> str:37 return "-Infinity"38 39 def __hash__(self) -> int:40 return hash(repr(self))41 42 def __lt__(self, other: object) -> bool:43 return True44 45 def __le__(self, other: object) -> bool:46 return True47 48 def __eq__(self, other: object) -> bool:49 return isinstance(other, self.__class__)50 51 def __gt__(self, other: object) -> bool:52 return False53 54 def __ge__(self, other: object) -> bool:55 return False56 57 def __neg__(self: object) -> InfinityType:58 return Infinity59 60 61NegativeInfinity = NegativeInfinityType()62 