Closed dfee closed 6 years ago
Consider the following class:
import dataclasses as dc @dc.dataclass class Dimmension: kind: str @classmethod def create( cls, kind, ) -> 'Dimmension': return cls(kind=kind)
the last line of the constructor actually throws a mypy error: Unexpected keyword argument "kind" for "Dimmension".
Unexpected keyword argument "kind" for "Dimmension"
Removing "Dimmension" as the return annotation from create removes the error.
"Dimmension"
create
This is not a dataclass problem, dataclasses are not yet supported by mypy, the support is planned to be added soon (in time for Python 3.7 release).
Closing, since this isn't a dataclasses 3.6 back port issue.
Consider the following class:
the last line of the constructor actually throws a mypy error:
Unexpected keyword argument "kind" for "Dimmension"
.Removing
"Dimmension"
as the return annotation fromcreate
removes the error.