Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/packaging/_structures.py: 56%
36 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-01 06:54 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-01 06:54 +0000
1# This file is dual licensed under the terms of the Apache License, Version
2# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3# for complete details.
6class InfinityType:
7 def __repr__(self) -> str:
8 return "Infinity"
10 def __hash__(self) -> int:
11 return hash(repr(self))
13 def __lt__(self, other: object) -> bool:
14 return False
16 def __le__(self, other: object) -> bool:
17 return False
19 def __eq__(self, other: object) -> bool:
20 return isinstance(other, self.__class__)
22 def __gt__(self, other: object) -> bool:
23 return True
25 def __ge__(self, other: object) -> bool:
26 return True
28 def __neg__(self: object) -> "NegativeInfinityType":
29 return NegativeInfinity
32Infinity = InfinityType()
35class NegativeInfinityType:
36 def __repr__(self) -> str:
37 return "-Infinity"
39 def __hash__(self) -> int:
40 return hash(repr(self))
42 def __lt__(self, other: object) -> bool:
43 return True
45 def __le__(self, other: object) -> bool:
46 return True
48 def __eq__(self, other: object) -> bool:
49 return isinstance(other, self.__class__)
51 def __gt__(self, other: object) -> bool:
52 return False
54 def __ge__(self, other: object) -> bool:
55 return False
57 def __neg__(self: object) -> InfinityType:
58 return Infinity
61NegativeInfinity = NegativeInfinityType()