Skip to content
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

Improve handling of overloads with ParamSpec #12953

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

AlexWaygood
Copy link
Member

Description

Fixes #12922 (a crash report).

Mypy's logic for overlapping overloads currently doesn't account for the existence of ParamSpecs. This PR fixes that.

Test Plan

I added a test that ensures that the crash report in #12922 is fixed, and that ensures that basic type inference works as expected.
I'm not 100% confident I've covered all edge cases, but I think this is better than the status quo, anyway.

@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good to me, just had some nits

mypy/meet.py Show resolved Hide resolved
mypy/meet.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

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

@hauntsaninja hauntsaninja merged commit 9b4bce9 into python:master Jun 7, 2022
@AlexWaygood AlexWaygood deleted the paramspec-overloads branch June 7, 2022 23:52
@AlexWaygood
Copy link
Member Author

Thanks @hauntsaninja!

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.

Crash involving ParamSpec, Concatenate and overloads
2 participants