KEMBAR78
Friendlier errors for PEP 612 by hauntsaninja · Pull Request #12832 · python/mypy · GitHub
Skip to content

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions

This comment has been minimized.

)
if maybe_ret is None:
# Callable[?, RET] (where ? is something invalid)
# TODO(PEP612): change error to mention paramspec, once we actually have some
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or Concatenate?

Copy link
Member

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.

Copy link
Member

@emmatyping emmatyping May 21, 2022

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.

Copy link
Collaborator Author

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

@hauntsaninja hauntsaninja changed the title Improve Callable error for PEP 612 Friendlier errors for PEP 612 May 21, 2022
@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@JukkaL JukkaL left a 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.

@JukkaL JukkaL merged commit 24ef8d0 into python:master May 23, 2022
JukkaL pushed a commit that referenced this pull request May 23, 2022
Co-authored-by: hauntsaninja <>
@hauntsaninja hauntsaninja deleted the pspec-error branch May 23, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants