We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe I've misunderstood how parameter specification variables are supposed to used, but this is what I have:
from typing import TypeVar, Generic, ParamSpec, Protocol, Callable from functools import partial T = TypeVar("T", covariant=True) P = ParamSpec("P") class JittedFunction(Protocol, Generic[P, T]): def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T: ... def lower(self) -> int: ... def jit(fun: Callable[P, T], *, x: int) -> JittedFunction[P, T]: pass @partial(jit, x=2) # error: Argument 1 to "partial" has incompatible type "Callable[[Callable[P, Any], NamedArg(int, 'x')], JittedFunction[P]]"; expected "Callable[..., JittedFunction[P]]" [arg-type] def f(y: int) -> int: return y
The text was updated successfully, but these errors were encountered:
Your code looks correct to me. This type checks without errors in pyright.
Sorry, something went wrong.
Thanks @erictraut ! You're always very helpful.
Original example works on master, likely fixed by #15837
Successfully merging a pull request may close this issue.
Maybe I've misunderstood how parameter specification variables are supposed to used, but this is what I have:
The text was updated successfully, but these errors were encountered: