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.
pull/9329/head
Dylan Baker 3 years ago committed by Daniel Mensinger
parent d2fa6d5080
commit 7e43432a0c
  1. 2
      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

Loading…
Cancel
Save