Skip to content

Fixed bug in type narrowing for literal patterns. The runtime uses eq… - #11028

Merged
Eric Traut (erictraut) merged 1 commit into
mainfrom
issue-11026
Oct 14, 2025
Merged

Eric Traut (erictraut) merged 1 commit into
mainfrom
issue-11026

Conversation

@erictraut

Copy link
Copy Markdown
Collaborator

…uality checks, so matching against the pattern 3 cannot necessarily narrow the type to Literal[3]. This addresses #11026.

…uality checks, so matching against the pattern `3` cannot necessarily narrow the type to `Literal[3]`. This addresses #11026.
@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. ✅

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