diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-11-04 10:53:17 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-11-22 11:28:43 -0800 |
commit | d05a0fbf335b23814ede488c668f43c97fd4f06c (patch) | |
tree | 778d090a90d79babd42bacc5a1d70a3fc9f67d4a /mesonbuild/interpreter/kwargs.py | |
parent | 3295621706d47ca6f4731695e9c9acc0ddcc572b (diff) | |
download | meson-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.py | 7 |
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] |