diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-10-06 23:42:37 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-02-01 17:01:30 -0500 |
commit | a21af43200e13fa65e12bdbe5116a0cecc4990b3 (patch) | |
tree | 4db989be7c51dd745fa17e09b60d64f64f6f6bcc /mesonbuild/cmake | |
parent | 680b5ff819bf36397ea560f802510bce5b83f6bc (diff) | |
download | meson-a21af43200e13fa65e12bdbe5116a0cecc4990b3.zip meson-a21af43200e13fa65e12bdbe5116a0cecc4990b3.tar.gz meson-a21af43200e13fa65e12bdbe5116a0cecc4990b3.tar.bz2 |
micro-optimize: define typing-only objects in TYPE_CHECKING
Union types that exist solely for use as annotations don't need to be
created in normal runs.
Diffstat (limited to 'mesonbuild/cmake')
-rw-r--r-- | mesonbuild/cmake/executor.py | 4 | ||||
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index afd21ef..7482f54 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -33,8 +33,8 @@ if T.TYPE_CHECKING: from ..mesonlib import MachineChoice from ..programs import ExternalProgram -TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]] -TYPE_cache_key = T.Tuple[str, T.Tuple[str, ...], str, T.FrozenSet[T.Tuple[str, str]]] + TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]] + TYPE_cache_key = T.Tuple[str, T.Tuple[str, ...], str, T.FrozenSet[T.Tuple[str, str]]] class CMakeExecutor: # The class's copy of the CMake path. Avoids having to search for it diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index f453aa3..f88d091 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -59,9 +59,9 @@ if T.TYPE_CHECKING: from ..backend.backends import Backend from ..environment import Environment -TYPE_mixed = T.Union[str, int, bool, Path, BaseNode] -TYPE_mixed_list = T.Union[TYPE_mixed, T.Sequence[TYPE_mixed]] -TYPE_mixed_kwargs = T.Dict[str, TYPE_mixed_list] + TYPE_mixed = T.Union[str, int, bool, Path, BaseNode] + TYPE_mixed_list = T.Union[TYPE_mixed, T.Sequence[TYPE_mixed]] + TYPE_mixed_kwargs = T.Dict[str, TYPE_mixed_list] # Disable all warnings automatically enabled with --trace and friends # See https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_WARNING_CMPNNNN.html |