-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Friendlier errors for PEP 612 #12832
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -944,9 +944,9 @@ def analyze_callable_type(self, t: UnboundType) -> Type: | |||
) | |||
if maybe_ret is None: | |||
# Callable[?, RET] (where ? is something invalid) | |||
# TODO(PEP612): change error to mention paramspec, once we actually have some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Concatenate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though that's getting a bit much for an error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new language, maybe a note linking to some docs would be useful in addition however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Concatenate is why I went with the more generic "parameter specification" rather than "ParamSpec". This error is probably disproportionately encountered by new users, so don't want it to be too scary.
I could add a note for https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new error messages -- clearer and less confusing.
Co-authored-by: hauntsaninja <>
No description provided.