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
from typing import TypeVar, ParamSpec, Generic, Protocol from collections.abc import Callable from functools import partial V_co = TypeVar("V_co", covariant=True) P = ParamSpec("P") class Wrapped(Protocol, Generic[P, V_co]): def __call__(self, *args: P.args, **kwargs: P.kwargs) -> V_co: raise NotImplementedError def jit(fun: Callable[P, V_co], argnames: str | None = None ) -> Wrapped[P, V_co]: ... @partial(jit, argnames='debug') def some_function(debug: bool = False): pass some_function(debug=False) # a.py:22: error: Argument "debug" to "__call__" of "Wrapped" has incompatible type "bool"; expected "P.kwargs" [arg-type]
MyPy 1.6.1 is for some reason exposing "P.kwargs" and demanding it as a parameter!
(PyRight produces no errors.)
May possibly be related to #15215, but this gives a very different error.
The text was updated successfully, but these errors were encountered:
Works on master. (It however infers quite imprecise type, but this is because partial is imprecisely typed).
partial
Sorry, something went wrong.
@ilevkivskyi Should we leave an issue open regarding inferring a precise type for partial?
There is a separate issue for partial #1484
No branches or pull requests
MyPy 1.6.1 is for some reason exposing "P.kwargs" and demanding it as a parameter!
(PyRight produces no errors.)
May possibly be related to #15215, but this gives a very different error.
The text was updated successfully, but these errors were encountered: