You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromenumimportEnumfromtypingimportNamedTupleclassFoo(NamedTuple):
passclassFooEnum(Foo, Enum):
ITEM=Foo()
foo: Foo=FooEnum.ITEM# works on 1.15 but not 1.16
Actual Behavior
error: Incompatible types in assignment (expression has type "FooEnum", variable has type "Foo") [assignment]
Your Environment
Mypy version used: 1.16
Mypy command-line flags: defaults
Mypy configuration options from mypy.ini (and other config files): none
Python version used: 3.13
The text was updated successfully, but these errors were encountered:
hauntsaninja
changed the title
Incompatible types error when using Enums of a NamedTuple
[1.16 regression] Incompatible types error when using Enums of a NamedTupleJun 6, 2025
Bug Report
Seeing this regression on mypy 1.16 with Enums of NamedTuples values.
Note: Enums of plain classes or dataclasses work as expected.
To Reproduce
https://mypy-play.net/?mypy=1.16.0&python=3.13&flags=strict&gist=2c5d8ca22757aee67d917d8fec20ad7f
Actual Behavior
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: