Open
Description
Current problem
from dataclasses import dataclass, field
@dataclass
class Expandable:
_api: field()
var = []
Desired solution
Detect invalid or problematic usage in dataclasses.
Some ideas
- Invalid
field
call. It should be the value of the assignment - Missing type annotation
- Missing use of
field
->default_factory
for mutable types. Careful ofClassVars
as it might be intended for them. - Unsupported-version check as dataclasses require Python 3.7
--
It might be best to create a new checker class for it.
Additional context
No response