|
14 | 14 | import collections |
15 | 15 | import itertools |
16 | 16 | import re |
17 | | -from typing import Callable, SupportsInt, Union |
| 17 | +import typing as t |
18 | 18 |
|
19 | 19 | from ._structures import Infinity, InfinityType, NegativeInfinity, NegativeInfinityType |
20 | 20 |
|
21 | 21 | __all__ = ["VERSION_PATTERN", "InvalidVersion", "Version", "parse"] |
22 | 22 |
|
23 | | -InfiniteTypes = Union[InfinityType, NegativeInfinityType] |
24 | | -PrePostDevType = Union[InfiniteTypes, tuple[str, int]] |
25 | | -SubLocalType = Union[InfiniteTypes, int, str] |
26 | | -LocalType = Union[ |
| 23 | +InfiniteTypes = t.Union[InfinityType, NegativeInfinityType] |
| 24 | +PrePostDevType = t.Union[InfiniteTypes, tuple[str, int]] |
| 25 | +SubLocalType = t.Union[InfiniteTypes, int, str] |
| 26 | +LocalType = t.Union[ |
27 | 27 | NegativeInfinityType, |
28 | 28 | tuple[ |
29 | | - Union[ |
| 29 | + t.Union[ |
30 | 30 | SubLocalType, |
31 | 31 | tuple[SubLocalType, str], |
32 | 32 | tuple[NegativeInfinityType, SubLocalType], |
|
42 | 42 | PrePostDevType, |
43 | 43 | LocalType, |
44 | 44 | ] |
45 | | -VersionComparisonMethod = Callable[[CmpKey, CmpKey], bool] |
| 45 | +VersionComparisonMethod = t.Callable[[CmpKey, CmpKey], bool] |
46 | 46 |
|
47 | 47 | _Version = collections.namedtuple( |
48 | 48 | "_Version", |
@@ -477,7 +477,7 @@ def micro(self) -> int: |
477 | 477 |
|
478 | 478 | def _parse_letter_version( |
479 | 479 | letter: str, |
480 | | - number: str | bytes | SupportsInt, |
| 480 | + number: str | bytes | t.SupportsInt, |
481 | 481 | ) -> tuple[str, int] | None: |
482 | 482 | if letter: |
483 | 483 | # We consider there to be an implicit 0 in a pre-release if there is |
|
0 commit comments