Skip to content

Avoid unnecessary sum type expansion when narrowing - #22252

Merged
hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:simply
Oct 21, 2026
Merged

hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:simply

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

conditional_types already expands bool and enum types when the target is a matching literal.

Authored by Codex

conditional_types already expands bool and enum types when the target is
a matching literal.

Authored by Codex
@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/testing/util.py:80:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

@hauntsaninja
hauntsaninja merged commit 049dbf0 into python:master Oct 21, 2026
25 checks passed
@hauntsaninja
hauntsaninja deleted the simply branch October 21, 2026 16:21
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