diff --git a/crates/red_knot_python_semantic/resources/mdtest/annotations/callable.md b/crates/red_knot_python_semantic/resources/mdtest/annotations/callable.md index e906b5de39..29cef6cae3 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/annotations/callable.md +++ b/crates/red_knot_python_semantic/resources/mdtest/annotations/callable.md @@ -225,14 +225,16 @@ Using `Concatenate` as the first argument to `Callable`: from typing_extensions import Callable, Concatenate def _(c: Callable[Concatenate[int, str, ...], int]): - reveal_type(c) # revealed: (*args: @Todo(todo signature *args), **kwargs: @Todo(todo signature **kwargs)) -> int + # TODO: Should reveal the correct signature + reveal_type(c) # revealed: (...) -> int ``` And, as one of the parameter types: ```py def _(c: Callable[[Concatenate[int, str, ...], int], int]): - reveal_type(c) # revealed: (*args: @Todo(todo signature *args), **kwargs: @Todo(todo signature **kwargs)) -> int + # TODO: Should reveal the correct signature + reveal_type(c) # revealed: (...) -> int ``` ## Using `typing.ParamSpec` @@ -276,7 +278,8 @@ from typing_extensions import Callable, TypeVarTuple Ts = TypeVarTuple("Ts") def _(c: Callable[[int, *Ts], int]): - reveal_type(c) # revealed: (*args: @Todo(todo signature *args), **kwargs: @Todo(todo signature **kwargs)) -> int + # TODO: Should reveal the correct signature + reveal_type(c) # revealed: (...) -> int ``` And, using the legacy syntax using `Unpack`: @@ -285,7 +288,8 @@ And, using the legacy syntax using `Unpack`: from typing_extensions import Unpack def _(c: Callable[[int, Unpack[Ts]], int]): - reveal_type(c) # revealed: (*args: @Todo(todo signature *args), **kwargs: @Todo(todo signature **kwargs)) -> int + # TODO: Should reveal the correct signature + reveal_type(c) # revealed: (...) -> int ``` ## Member lookup diff --git a/crates/red_knot_python_semantic/src/types/signatures.rs b/crates/red_knot_python_semantic/src/types/signatures.rs index 4fcd669be2..811965cde9 100644 --- a/crates/red_knot_python_semantic/src/types/signatures.rs +++ b/crates/red_knot_python_semantic/src/types/signatures.rs @@ -895,7 +895,7 @@ impl<'db> Parameters<'db> { Parameter::keyword_variadic(Name::new_static("kwargs")) .with_annotated_type(todo_type!("todo signature **kwargs")), ], - is_gradual: false, + is_gradual: true, } }