aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-09-24 13:59:48 -0700
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-09-30 21:01:38 +0200
commit7e43432a0c1a2a951fa10bf2fd6930db9d4c4fcc (patch)
treeaca243faf64fa151318e0fcc971221d4c400c6a7
parentd2fa6d50809e6a5955999152f43a461595c6bc4c (diff)
downloadmeson-7e43432a0c1a2a951fa10bf2fd6930db9d4c4fcc.zip
meson-7e43432a0c1a2a951fa10bf2fd6930db9d4c4fcc.tar.gz
meson-7e43432a0c1a2a951fa10bf2fd6930db9d4c4fcc.tar.bz2
interpreterbase/decorators: KwargIfno validator must take an relaxed type
I've used any because it needs to be infinitely recursive, something that we simply can't model. But basically until it goes into validator we have no way of knowing what's going on, since one can write code like: ```python KwargInfo[str]('arg', object, validator=_some_very_complex_logic_to_get_specific_string) ``` As such, we can't assume that validator is receiving a type _T, it could be anything.
-rw-r--r--mesonbuild/interpreterbase/decorators.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index 54f4be3..88449ed 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -373,7 +373,7 @@ class KwargInfo(T.Generic[_T]):
since_values: T.Optional[T.Dict[str, str]] = None,
deprecated: T.Optional[str] = None,
deprecated_values: T.Optional[T.Dict[str, str]] = None,
- validator: T.Optional[T.Callable[[_T], T.Optional[str]]] = None,
+ validator: T.Optional[T.Callable[[T.Any], T.Optional[str]]] = None,
convertor: T.Optional[T.Callable[[_T], object]] = None,
not_set_warning: T.Optional[str] = None):
self.name = name