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

Fix OR pattern structural matching exhaustiveness #18119

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

shenyih0ng
Copy link
Contributor

@shenyih0ng shenyih0ng commented Nov 7, 2024

Fixes #18108

This PR fixes the issue of missing value comparisons in a MatchStmt due to OrPattern incorrectly narrowing down the type of the subject.

This comment has been minimized.

@shenyih0ng shenyih0ng force-pushed the fix/or-pattern-match-exhaustiveness branch from 4cd8a8c to 2c6a179 Compare November 10, 2024 08:59

This comment has been minimized.

@shenyih0ng shenyih0ng force-pushed the fix/or-pattern-match-exhaustiveness branch from 2c6a179 to ff90fbb Compare November 10, 2024 09:28
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@shenyih0ng shenyih0ng marked this pull request as ready for review November 10, 2024 10:10
Copy link
Collaborator

@brianschubert brianschubert left a comment

Choose a reason for hiding this comment

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

Nice! LGTM!

@JukkaL JukkaL merged commit f067db4 into python:master Nov 11, 2024
19 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.

Structural Pattern Matching Exhaustiveness check when using OR
3 participants