KEMBAR78
Improve handling of overloads with `ParamSpec` by AlexWaygood · Pull Request #12953 · python/mypy · GitHub
Skip to content

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

@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. 🤖🎉

@AlexWaygood AlexWaygood requested a review from hauntsaninja June 7, 2022 22:42
@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