Synthesized __dataclass_fields__
should be a ClassVar
#4157
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Pyright synthesizes a field called
__dataclass_fields__
for dataclass and dataclass-like (PEP 681) classes.It currently declares this synthesized field as a normal class-level variable (i.e. a class variable that can be overridden by an instance variable). It should probably be a
ClassVar
. Mypy models it as such.See mypy issue python/mypy#14029 for more context.
The text was updated successfully, but these errors were encountered: