Skip to content

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

Merged
erictraut merged 1 commit intomainfrom
issue-11026
Oct 14, 2025
Merged

Fixed bug in type narrowing for literal patterns. The runtime uses eq…#11028
erictraut merged 1 commit intomainfrom
issue-11026

Conversation

@erictraut
Copy link
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
Contributor

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

@erictraut erictraut merged commit 80eb0dc into main Oct 14, 2025
19 checks passed
@erictraut erictraut deleted the issue-11026 branch October 14, 2025 00:09
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