Specifiers
Specifier
Bases: Representation
, ToString
, Specification
Represents all possible specifiers.
Source code in versions/specifiers.py
44 45 |
|
SpecifierNever
Bases: Specifier
Represents specifiers that do not accept any versions.
Source code in versions/specifiers.py
51 52 53 54 55 56 57 58 59 |
|
SpecifierAlways
Bases: Specifier
Represents specifiers that accept all versions.
Source code in versions/specifiers.py
65 66 67 68 69 70 71 72 73 |
|
SpecifierOne
Represents specifiers that accept versions according to the
Operator
type.
Source code in versions/specifiers.py
79 80 81 82 83 84 85 86 |
|
SpecifierAny
Bases: Specifier
Represents collections of two or more specifiers that accept versions if any of the contained specifiers accept it.
Source code in versions/specifiers.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
SpecifierAll
Bases: Specifier
Represents collections of two or more specifiers that accept versions if and only if all of the contained specifiers accept it.
Source code in versions/specifiers.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
is_specifier(item: Any) -> TypeGuard[Specifier]
Checks if an item
is an instance of Specifier
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[Specifier]
|
Whether the |
Source code in versions/specifiers.py
193 194 195 196 197 198 199 200 201 202 |
|
is_specifier_never(item: Any) -> TypeGuard[SpecifierNever]
Checks if an item
is an instance of
SpecifierNever
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[SpecifierNever]
|
Whether the |
Source code in versions/specifiers.py
205 206 207 208 209 210 211 212 213 214 215 216 |
|
is_specifier_always(item: Any) -> TypeGuard[SpecifierAlways]
Checks if an item
is an instance of
SpecifierAlways
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[SpecifierAlways]
|
Whether the |
Source code in versions/specifiers.py
219 220 221 222 223 224 225 226 227 228 229 230 |
|
is_specifier_one(item: Any) -> TypeGuard[SpecifierOne]
Checks if an item
is an instance of
SpecifierOne
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[SpecifierOne]
|
Whether the |
Source code in versions/specifiers.py
233 234 235 236 237 238 239 240 241 242 243 244 |
|
is_specifier_any(item: Any) -> TypeGuard[SpecifierAny]
Checks if an item
is an instance of
SpecifierAny
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[SpecifierAny]
|
Whether the |
Source code in versions/specifiers.py
247 248 249 250 251 252 253 254 255 256 257 258 |
|
is_specifier_all(item: Any) -> TypeGuard[SpecifierAll]
Checks if an item
is an instance of
SpecifierAll
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Any
|
The item to check. |
required |
Returns:
Type | Description |
---|---|
TypeGuard[SpecifierAll]
|
Whether the |
Source code in versions/specifiers.py
261 262 263 264 265 266 267 268 269 270 271 272 |
|