aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/kwargs.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-11-04 10:53:17 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-11-22 11:28:43 -0800
commitd05a0fbf335b23814ede488c668f43c97fd4f06c (patch)
tree778d090a90d79babd42bacc5a1d70a3fc9f67d4a /mesonbuild/interpreter/kwargs.py
parent3295621706d47ca6f4731695e9c9acc0ddcc572b (diff)
downloadmeson-d05a0fbf335b23814ede488c668f43c97fd4f06c.zip
meson-d05a0fbf335b23814ede488c668f43c97fd4f06c.tar.gz
meson-d05a0fbf335b23814ede488c668f43c97fd4f06c.tar.bz2
interpreter: use typed_* args for the summary function
This also includes a few type annotation cleans for the Summary object. Getting the positional arguments exactly right is impossible, as this is really a function with two different signatures: ``` summary(value: dictionary): void summary(key: string, value: any): void ``` We can get close enough in the typed_pos_args by enforcing that there are two parameters, one required and one optional, and that the first must be either a dictionary or a string.
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r--mesonbuild/interpreter/kwargs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py
index 50bc5d1..4777d8a 100644
--- a/mesonbuild/interpreter/kwargs.py
+++ b/mesonbuild/interpreter/kwargs.py
@@ -219,3 +219,10 @@ class _FoundProto(Protocol):
class Subdir(TypedDict):
if_found: T.List[_FoundProto]
+
+
+class Summary(TypedDict):
+
+ section: str
+ bool_yn: bool
+ list_sep: T.Optional[str]