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
I believe mypy should reject non-existent fields when dataclasses.replace is used.
To Reproduce
fromdataclassesimportdataclass, replace@dataclass(frozen=True)classA:
x : inty : inta=A(0, 1)
b=replace(a, x=1) # okc=replace(a, not_a_field=1) # should be: error: "A" has no attribute "not_a_field" [attr-defined]