-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
I have added preliminary support for dataclasses in python/typeshed#1944.
These seem to work for declarations, but not for instantiation. For example:
@dataclass
class D0:
x: int
d0 = D0(x=0)
The constructor is erroneously flagged, and points to the __init__
annotation for object
:
error: Unexpected keyword argument "x" for "D0"
/Users/gwk/work/python/mypy/typeshed/stdlib/3/builtins.pyi:38:5: note: "D0" defined here
It appears that we need to teach mypy about dataclasses more deeply.
charlax, dalazx, Bogdanp, iddan, david-gang and 7 more