-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Callable protocol does not infer generic parameters #15827
New issue
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
Comments
PEP 612 (which introduced ParamSpecs) says that it is not legal to include a keyword argument between If you're interested in the reason why this limitation was required in PEP 612, please refer to Khttps://peps.python.org/pep-0612/#id2. Search for the text "Note that this also why we have to reject signatures of the form". If you remove the illegal |
Ah i see, thanks for clarifying. Is there any current way to correctly type this code in that case? |
There's unfortunately no way to correctly type this code if you want If you're willing to make |
@erictraut Is there an issue for this bug? |
I don't know if this is covered by an existing bug. You could lo 5ED9 ok through the open bugs with the "topic-paramspec" tag to see if any of them look like they cover the same issue. |
Bug Report
Callable protocols don't seem to be working quite right with generics?
To Reproduce
Expected Behavior
I feel like this should work in theory?
Actual Behavior
Your Environment
https://mypy-play.net/?mypy=latest&python=3.11
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: