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

Do not prioritize ParamSpec signatures during overload resolution #18033

Merged

Conversation

sterliakov
Copy link
Contributor

Closes #18027.

Var-args and star-args overloads are handled first to handle functions like zip correctly in cases like zip(*[[1],[2],[3]]). That does not seem to be necessary in case of ParamSpec overloads (or at least such use case is much less obvious).

So this PR prevents ParamSpec overloads from floating up in the list of overload targets.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of 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.

Thanks for the quick fix!

@JukkaL JukkaL merged commit 1cb8cc4 into python:master Oct 25, 2024
18 checks passed
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.

[1.12, 1.13 regression] typing.overload and ParamSpec
2 participants