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
{{ message }}
Repository navigation
Regression: "Attributes without a default cannot follow attributes with one" despite dataclass_transform with kw_only_default=True #14629
Since mypy 1.0 the following code results in the following type error:
import envee
@envee.environment
class Environment:
one: int = 1
two: int # error: Attributes without a default cannot follow attributes with one [misc]`
env = envee.read(Environment)
The environment decorator of the envee library ensures that a dataclass with kw_only is created (if supported by Python) and indicates this using dataclass_transform(kw_only_default=True).
Activity
JelleZijlstra commentedon Feb 7, 2023
cc @wesleywright for dataclass-transform. I added topic-dataclass-transformPEP 681
to classify similar issues in the future. I believe #14580 will fix this issue.