added release.txt blurb. Fixed spelling typo in Defaults.xml
[scons.git] / SCons / Util / sctyping.py
blob5da5eb9fe7919349bbd3b25ce62869d496f3471b
1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
5 """Various SCons type aliases.
7 For representing complex types across the entire repo without risking
8 circular dependencies, we take advantage of TYPE_CHECKING to import
9 modules in an tool-only environment. This allows us to introduce
10 hinting that resolves as expected in IDEs without clashing at runtime.
12 For consistency, it's recommended to ALWAYS use these aliases in a
13 type-hinting context, even if the type is actually expected to be
14 resolved in a given file.
15 """
17 from typing import Union, TYPE_CHECKING
19 if TYPE_CHECKING:
20 import SCons.Executor
23 # Because we don't have access to TypeAlias until 3.10, we have to utilize
24 # 'Union' for all aliases. As it expects at least two entries, anything that
25 # is only represented with a single type needs to list itself twice.
26 ExecutorType = Union["SCons.Executor.Executor", "SCons.Executor.Executor"]
29 # Local Variables:
30 # tab-width:4
31 # indent-tabs-mode:nil
32 # End:
33 # vim: set expandtab tabstop=4 shiftwidth=4: