aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-11-19 10:42:38 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-11-22 12:24:33 -0800
commit762c504612a15109451c647752227be352e15e62 (patch)
treec1e324338c1c9cb18b24ffcdcf01e3777b9b00f2 /mesonbuild/interpreterbase
parentecc47d67a945760c3d5e739581fa984bfea6a840 (diff)
downloadmeson-762c504612a15109451c647752227be352e15e62.zip
meson-762c504612a15109451c647752227be352e15e62.tar.gz
meson-762c504612a15109451c647752227be352e15e62.tar.bz2
typed_kwargs: use | for type unions, not ,
Python uses this syntax now, as does typescript and other languages
Diffstat (limited to 'mesonbuild/interpreterbase')
-rw-r--r--mesonbuild/interpreterbase/decorators.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index 817cb85..8832d29 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -326,9 +326,9 @@ class ContainerTypeInfo:
:return: string to be printed
"""
- container = 'dict' if self.container is dict else 'list'
+ container = 'dict' if self.container is dict else 'array'
if isinstance(self.contains, tuple):
- contains = ','.join([t.__name__ for t in self.contains])
+ contains = ' | '.join([t.__name__ for t in self.contains])
else:
contains = self.contains.__name__
s = f'{container}[{contains}]'
@@ -471,8 +471,8 @@ def typed_kwargs(name: str, *types: KwargInfo) -> T.Callable[..., T.Any]:
"""describe a raw type (ie, one that is not a ContainerTypeInfo)."""
if isinstance(t, list):
if t:
- return f"list[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t)))}]"
- return 'list[]'
+ return f"array[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t)))}]"
+ return 'array[]'
elif isinstance(t, dict):
if t:
return f"dict[{' | '.join(sorted(mesonlib.OrderedSet(type(v).__name__ for v in t.values())))}]"