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
new generics should be inferred as covariant instead of invariant on frozen dataclasses #17692
# mypy: enable-incomplete-feature=NewGenericSyntaxfromdataclassesimportdataclass@dataclass(frozen=True)classFoo[T]:
value: Tfoo=Foo[int](value=1)
bar: Foo[object] =foo# error: Incompatible types in assignment (expression has type "Foo[int]", variable has type "Foo[object]") [assignment]
changed the title [-]new generics shouyld be inferred as covariant instead of invariant on frozen dataclasses[/-][+]new generics should be inferred as covariant instead of invariant on frozen dataclasses[/+]on Aug 19, 2024
Activity
[-]new generics shouyld be inferred as covariant instead of invariant on frozen dataclasses[/-][+]new generics should be inferred as covariant instead of invariant on frozen dataclasses[/+]smheidrich commentedon Aug 20, 2025
Same issue as
?