summaryrefslogtreecommitdiff
path: root/mesonbuild/utils/core.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-10-06 23:42:37 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-02-01 17:01:30 -0500
commita21af43200e13fa65e12bdbe5116a0cecc4990b3 (patch)
tree4db989be7c51dd745fa17e09b60d64f64f6f6bcc /mesonbuild/utils/core.py
parent680b5ff819bf36397ea560f802510bce5b83f6bc (diff)
downloadmeson-a21af43200e13fa65e12bdbe5116a0cecc4990b3.tar.gz
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/utils/core.py')
-rw-r--r--mesonbuild/utils/core.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/mesonbuild/utils/core.py b/mesonbuild/utils/core.py
index b0c2b312f..43984131d 100644
--- a/mesonbuild/utils/core.py
+++ b/mesonbuild/utils/core.py
@@ -34,15 +34,7 @@ if T.TYPE_CHECKING:
EnvironOrDict = T.Union[T.Dict[str, str], os._Environ[str]]
-
-__all__ = [
- 'MesonException',
- 'MesonBugException',
- 'HoldableObject',
- 'EnvInitValueType',
- 'EnvironmentVariables',
- 'ExecutableSerialisation',
-]
+ EnvInitValueType = T.Dict[str, T.Union[str, T.List[str]]]
class MesonException(Exception):
@@ -76,8 +68,6 @@ class HoldableObject(metaclass=abc.ABCMeta):
''' Dummy base class for all objects that can be
held by an interpreter.baseobjects.ObjectHolder '''
-EnvInitValueType = T.Dict[str, T.Union[str, T.List[str]]]
-
class EnvironmentVariables(HoldableObject):
def __init__(self, values: T.Optional[EnvInitValueType] = None,
init_method: Literal['set', 'prepend', 'append'] = 'set', separator: str = os.pathsep) -> None: