Skip to content

Update the overlapping check for tuples to account for NamedTuples #18564

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

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

A5rocks
Copy link
Collaborator

@A5rocks A5rocks commented Jan 29, 2025

Fixes #18562.

Fixes #6623.

Fixes #18520. (Only incidentally and I'm not exactly sure why.)

I was investigating what input mypy thought satisfied both overloads and I found that mypy is missing a check on the fallback type.

This comment has been minimized.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

CPython (peg_generator) (https://github.com/python/cpython): 1.83x faster (25.4s -> 13.9s in a single noisy sample)

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 fix!

@JukkaL JukkaL merged commit e2b821b into python:master Jan 30, 2025
18 checks passed
@A5rocks A5rocks deleted the fix-namedtuple-overlapping branch January 30, 2025 11:11
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
…ython#18564)

Fixes python#18562.

Fixes python#6623.

Fixes python#18520. (Only incidentally
and I'm not exactly sure why.)

I was investigating what input mypy thought satisfied both overloads and
I found that mypy is missing a check on the fallback type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants