Skip to content

Better match narrowing for irrefutable mapping patterns#20906

Draft
hauntsaninja wants to merge 2 commits intopython:masterfrom
hauntsaninja:narrow107
Draft

Better match narrowing for irrefutable mapping patterns#20906
hauntsaninja wants to merge 2 commits intopython:masterfrom
hauntsaninja:narrow107

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 26, 2026

Fixes #18950
Fixes this comment #19081 (comment) (previously improved on by #20744 and #20782 )

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja marked this pull request as draft February 26, 2026 19:19
@hauntsaninja
Copy link
Collaborator Author

Hm, need to make this a little bit more principled

@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.

Narrow mapping types when pattern-matching an empty mapping

1 participant