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
(馃悶) false negative with dataclass "non-default argument follows default argument"聽#12137
I don't see anywhere that this behavior is documented, but the runtime logic is clearly inheriting the default value from the base class even thought the child class doesn't provide a default value. This check was also missing in pyright, so I just added it.
Activity
erictraut commentedon Feb 7, 2022
I don't see anywhere that this behavior is documented, but the runtime logic is clearly inheriting the default value from the base class even thought the child class doesn't provide a default value. This check was also missing in pyright, so I just added it.
sobolevn commentedon Feb 10, 2022
Funny thing, this code works correctly:
But,
mypyis confused aboutaredefinition in OP's example.noooonee commentedon Nov 21, 2024
I happened saw a similar question, can this answer fix your issue?
https://stackoverflow.com/a/69822584/1227329
JonasFiechter commentedon Jul 10, 2025
Hello @noooonee. Adding
(kw_only=True)into the decorator function Works for me, thanks