Skip to content

Further improve match statement narrowing against unions#20744

Draft
hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja:matchtup
Draft

Further improve match statement narrowing against unions#20744
hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja:matchtup

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 5, 2026

I realised there is a simpler and more complete approach than the one taken in #19600.
This adds the new "Step 2" to the original code. Best way to review the diff is probably to check it out and review it squashed with #19600 , but really the net logic change is just "Step 2"

I realised there is a simpler and more powerful approach than the one
taken in python#19600. This basically adds the new "Step 2" to the original
code.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

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

@hauntsaninja hauntsaninja marked this pull request as draft February 5, 2026 08:24
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 participant