Skip to content

Fix Enum containment operand types on Python 3.10 and 3.11 - #16300

Merged
AlexWaygood merged 1 commit into
python:mainfrom
carljm:main
Aug 25, 2026
Merged

Fix Enum containment operand types on Python 3.10 and 3.11#16300
AlexWaygood merged 1 commit into
python:mainfrom
carljm:main

Conversation

@carljm

@carljm carljm commented Aug 25, 2026

Copy link
Copy Markdown
Member

We received a bug report about this in ty. On Python 3.10 and 3.11, it is a runtime error to check containment of anything that is not an Enum instance in an Enum.

Fixes astral-sh/ty#4389

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
AlexWaygood merged commit c2944c4 into python:main Aug 25, 2026
88 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.

False negative for StrEnum containment check on Python 3.11

2 participants