Skip to content

Narrow match pattern AST annotations to concrete variants - #22000

Open
adamtheturtle wants to merge 1 commit into
python:masterfrom
adamtheturtle:typing/concrete-pattern-nodes
Open

adamtheturtle wants to merge 1 commit into
python:masterfrom
adamtheturtle:typing/concrete-pattern-nodes

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 17, 2026

Copy link
Copy Markdown

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