You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet generates a main.py:7: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type] error, though the suggestion is followed
It's supposed to be a wrapper that schedules a call for later (typically for dispatching to a job queue)
PEP 612, which introduced ParamSpec to the type system, specifies that a *args: P.args and **kwargs: P.kwargs parameter must be located next to each other. You cannot insert additional keyword arguments between them, as you have done in your example. Mypy's error message here could be improved.
Bug Report
The following snippet generates a
main.py:7: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type]
error, though the suggestion is followedIt's supposed to be a wrapper that schedules a call for later (typically for dispatching to a job queue)
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.11&gist=e0bea0d9c56d64d145b87c80bd003c77
Expected Behavior
There should be no error:
Actual Behavior
main.py:7: error: ParamSpec must have "*args" typed as "P.args" and "**kwargs" typed as "P.kwargs" [valid-type]
Your Environment
mypy.ini
(and other config files): from playgroundThe text was updated successfully, but these errors were encountered: