Bug Report, To Reproduce, and Actual Behaviour
If the enum member's name to compare isn't equal to the comparing value, a false positive comparison-overlap is triggered. See mypy Playground:
fromenumimportEnumclassA(str, Enum): # Same behaviour if `class A(enum.StrEnum)`a="b"A.a=="a"# OKA.a=="b"# E: Non-overlapping equality check (left operand type: "Literal[A.a]", right operand type: "Literal['b']") [comparison-overlap]
Expected Behavior
No errors
Your Environment
- Mypy version used: 1.17, master
- Python version used: 3.12
Bug Report, To Reproduce, and Actual Behaviour
If the enum member's name to compare isn't equal to the comparing value, a false positive
comparison-overlapis triggered. See mypy Playground:Expected Behavior
No errors
Your Environment