Skip to content

Better match narrowing for irrefutable sequence patterns#20782

Open
hauntsaninja wants to merge 2 commits intopython:masterfrom
hauntsaninja:narrow95
Open

Better match narrowing for irrefutable sequence patterns#20782
hauntsaninja wants to merge 2 commits intopython:masterfrom
hauntsaninja:narrow95

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 11, 2026

The changes around narrow_sequence_child:

Fixes #13955
Helps with things in #19081

The changes around narrow_sequence_child:
- implement my suggestion from here:
  python#18091 (review)
- remove an is_subtype check I don't understand
@github-actions
Copy link
Contributor

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

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.

No narrowing of sequence types after a sequence pattern case in a match statement

1 participant