Skip to content

Fix custom equality handling for membership narrowing in static containers#21706

Merged
hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:customeqenum
Jul 8, 2026
Merged

Fix custom equality handling for membership narrowing in static containers#21706
hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:customeqenum

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

This was an issue in the new feature #21461

In narrow_type_by_identity_equality we check for custom equality before coercing to literals, and this was done the wrong way round here

Fixes #21703

…iners

This was an issue in the new feature python#21461

In narrow_type_by_identity_equality we check for custom equality before
coercing to literals, and this was done the wrong way round here

Fixes python#21703
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

@hauntsaninja hauntsaninja merged commit 77ccc7a into python:master Jul 8, 2026
25 checks passed
@hauntsaninja hauntsaninja deleted the customeqenum branch July 8, 2026 18:48
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.

[2.2 regression] unreachable code regression with custom equality enum membership check

1 participant