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/mlog.py | |
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/mlog.py')
-rw-r--r-- | mesonbuild/mlog.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index b778bfa..471934f 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -31,6 +31,8 @@ if T.TYPE_CHECKING: from .mparser import BaseNode + TV_Loggable = T.Union[str, 'AnsiDecorator', StringProtocol] + TV_LoggableList = T.List[TV_Loggable] """This is (mostly) a standalone module used to write logging information about Meson runs. Some output goes to screen, @@ -153,9 +155,6 @@ class AnsiDecorator: def __str__(self) -> str: return self.get_text(colorize_console()) -TV_Loggable = T.Union[str, AnsiDecorator, 'StringProtocol'] -TV_LoggableList = T.List[TV_Loggable] - class AnsiText: def __init__(self, *args: 'SizedStringProtocol'): self.args = args |