Код: Выделить всё
def foo(optional_type_restricted_input: bool = False, **kwargs: int):
pass
foo(**{"some_input":5}) # Error
< /code>
Pylance повышает:
Argument of type "int" cannot be assigned to parameter "type_restricted_input" of type "bool" in function "foo"< /code>
"int" is not assignable to "bool"
def foo(required_type_restricted_input: bool, **kwargs: int):
pass
# OK, but should not:
foo(**{"required_type_restricted_input": 5, "some_input":True})
< /code>
Как, кроме добавления # type: игнорировать < /code> ко всем вызовам функций, могу ли я разрешить эти ошибки?>
Подробнее здесь: https://stackoverflow.com/questions/796 ... nary-input