Skip to content

Narrow match pattern AST annotations to concrete variants - #22000

Merged
hauntsaninja merged 1 commit into
python:masterfrom
adamtheturtle:typing/concrete-pattern-nodes
Sep 19, 2026
Merged

hauntsaninja merged 1 commit into
python:masterfrom
adamtheturtle:typing/concrete-pattern-nodes

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

This lets clients exhaustively match a pattern with assert_never without a local type assertion. Downstream example: mypy-strict-kwargs#858.

@github-actions

Copy link
Copy Markdown
Contributor

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

@adamtheturtle
adamtheturtle marked this pull request as ready for review September 17, 2026 14:58
@hauntsaninja
hauntsaninja merged commit df1b028 into python:master Sep 19, 2026
25 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.

2 participants