comparison env/lib/python3.9/site-packages/packaging/_structures.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
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.
4 from __future__ import absolute_import, division, print_function
5
6
7 class InfinityType(object):
8 def __repr__(self):
9 # type: () -> str
10 return "Infinity"
11
12 def __hash__(self):
13 # type: () -> int
14 return hash(repr(self))
15
16 def __lt__(self, other):
17 # type: (object) -> bool
18 return False
19
20 def __le__(self, other):
21 # type: (object) -> bool
22 return False
23
24 def __eq__(self, other):
25 # type: (object) -> bool
26 return isinstance(other, self.__class__)
27
28 def __ne__(self, other):
29 # type: (object) -> bool
30 return not isinstance(other, self.__class__)
31
32 def __gt__(self, other):
33 # type: (object) -> bool
34 return True
35
36 def __ge__(self, other):
37 # type: (object) -> bool
38 return True
39
40 def __neg__(self):
41 # type: (object) -> NegativeInfinityType
42 return NegativeInfinity
43
44
45 Infinity = InfinityType()
46
47
48 class NegativeInfinityType(object):
49 def __repr__(self):
50 # type: () -> str
51 return "-Infinity"
52
53 def __hash__(self):
54 # type: () -> int
55 return hash(repr(self))
56
57 def __lt__(self, other):
58 # type: (object) -> bool
59 return True
60
61 def __le__(self, other):
62 # type: (object) -> bool
63 return True
64
65 def __eq__(self, other):
66 # type: (object) -> bool
67 return isinstance(other, self.__class__)
68
69 def __ne__(self, other):
70 # type: (object) -> bool
71 return not isinstance(other, self.__class__)
72
73 def __gt__(self, other):
74 # type: (object) -> bool
75 return False
76
77 def __ge__(self, other):
78 # type: (object) -> bool
79 return False
80
81 def __neg__(self):
82 # type: (object) -> InfinityType
83 return Infinity
84
85
86 NegativeInfinity = NegativeInfinityType()