FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Better match narrowing for irrefutable mapping patterns by hauntsaninja · Pull Request #20906 · python/mypy · GitHub

Repository navigation

Better match narrowing for irrefutable mapping patterns - #20906

Merged
hauntsaninja merged 2 commits into
python:masterfrom
hauntsaninja:narrow107
Mar 4, 2026
Merged

hauntsaninja merged 2 commits into
python:masterfrom
hauntsaninja:narrow107

Conversation

hauntsaninja commented Feb 26, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

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

This comment has been minimized.

hauntsaninja marked this pull request as draft February 26, 2026 19:19

Copy link
Copy Markdown
Collaborator Author

Hm, need to make this a little bit more principled

Copy link
Copy Markdown
Contributor

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

hauntsaninja marked this pull request as ready for review March 4, 2026 08:06

Copy link
Copy Markdown
Collaborator Author

Actually I'm going to go ahead and just merge this, since I want it in 1.20. The Any special case is not the worst thing ever

hauntsaninja merged commit e413220 into python:master Mar 4, 2026
24 checks passed
hauntsaninja deleted the narrow107 branch March 4, 2026 08:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL