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
{{ message }}
Repository navigation
[1.16 regression] Incompatible types error when using Enums of a NamedTuple #19242
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
changed the title [-]Incompatible types error when using `Enum`s of a `NamedTuple`[/-][+][1.16 regression] Incompatible types error when using `Enum`s of a `NamedTuple`[/+]on Jun 6, 2025
Activity
A5rocks commentedon Jun 6, 2025
cc @sobolevn
[-]Incompatible types error when using `Enum`s of a `NamedTuple`[/-][+][1.16 regression] Incompatible types error when using `Enum`s of a `NamedTuple`[/+]