|
14 | 14 | from enum import Enum |
15 | 15 | from functools import lru_cache |
16 | 16 | from pathlib import Path, PurePath |
17 | | -from typing import TYPE_CHECKING, Any, TypeVar |
| 17 | +from typing import TYPE_CHECKING, Any, TypeVar, Union |
18 | 18 |
|
19 | 19 | from deprecated.classic import deprecated |
20 | 20 |
|
|
66 | 66 |
|
67 | 67 | WINDOWS = sys.platform == "win32" |
68 | 68 |
|
69 | | -CLASS_NAME = ClassDefinitionName | str |
70 | | -SLOT_NAME = SlotDefinitionName | str |
71 | | -SUBSET_NAME = SubsetDefinitionName | str |
72 | | -TYPE_NAME = TypeDefinitionName | str |
73 | | -ENUM_NAME = EnumDefinitionName | str |
| 69 | +CLASS_NAME = Union[ClassDefinitionName, str] |
| 70 | +SLOT_NAME = Union[SlotDefinitionName, str] |
| 71 | +SUBSET_NAME = Union[SubsetDefinitionName, str] |
| 72 | +TYPE_NAME = Union[TypeDefinitionName, str] |
| 73 | +ENUM_NAME = Union[EnumDefinitionName, str] |
74 | 74 |
|
75 | 75 | ElementType = TypeVar("ElementType", bound=Element) |
76 | | -ElementNameType = TypeVar("ElementNameType", bound=ElementName | str) |
| 76 | +ElementNameType = TypeVar("ElementNameType", bound=Union[ElementName, str]) |
77 | 77 | DefinitionType = TypeVar("DefinitionType", bound=Definition) |
78 | | -DefinitionNameType = TypeVar("DefinitionNameType", bound=DefinitionName | str) |
| 78 | +DefinitionNameType = TypeVar("DefinitionNameType", bound=Union[DefinitionName, str]) |
79 | 79 | ElementDict = dict[ElementNameType, ElementType] |
80 | 80 | DefDict = dict[DefinitionNameType, DefinitionType] |
81 | 81 |
|
|
0 commit comments