summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-10-02 09:09:06 -0700
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-10-14 19:11:53 +0300
commit7ea56ab96ebeab1d271098e19d1c0d462dfe22b1 (patch)
treeb65c22e72bd88c5d500565b844953b230346c74d
parent8e1a170c54419c0ca2f89aeaa165d8b40c8d7277 (diff)
downloadmeson-7ea56ab96ebeab1d271098e19d1c0d462dfe22b1.tar.gz
build: Use `TypeAlias` decoration
Which can help type checkers in some cases
-rw-r--r--mesonbuild/build.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0b6400732..5d4d99a97 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -36,7 +36,7 @@ from .compilers import (
from .interpreterbase import FeatureNew, FeatureDeprecated
if T.TYPE_CHECKING:
- from typing_extensions import Literal, TypedDict
+ from typing_extensions import Literal, TypeAlias, TypedDict
from . import environment
from ._typing import ImmutableListProtocol
@@ -50,10 +50,10 @@ if T.TYPE_CHECKING:
from .modules import ModuleState
from .mparser import BaseNode
- GeneratedTypes = T.Union['CustomTarget', 'CustomTargetIndex', 'GeneratedList']
- LibTypes = T.Union['SharedLibrary', 'StaticLibrary', 'CustomTarget', 'CustomTargetIndex']
- BuildTargetTypes = T.Union['BuildTarget', 'CustomTarget', 'CustomTargetIndex']
- ObjectTypes = T.Union[str, 'File', 'ExtractedObjects', 'GeneratedTypes']
+ GeneratedTypes: TypeAlias = T.Union['CustomTarget', 'CustomTargetIndex', 'GeneratedList']
+ LibTypes: TypeAlias = T.Union['SharedLibrary', 'StaticLibrary', 'CustomTarget', 'CustomTargetIndex']
+ BuildTargetTypes: TypeAlias = T.Union['BuildTarget', 'CustomTarget', 'CustomTargetIndex']
+ ObjectTypes: TypeAlias = T.Union[str, 'File', 'ExtractedObjects', 'GeneratedTypes']
class DFeatures(TypedDict):