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
Improve error handling for dataclass inheritance (#13531)
This pull request:
1. Fixes#8334. Overriding a dataclass attribute with a method or
property now results in an error message, not a crash.
(Overriding an attribute with a non-attribute at runtime will
result in either inconsistent behavior or an exception, so
I think unconditionally disallowing this is fine.)
2. Makes mypy report an error if you try subclassing a frozen
dataclass with a non-frozen one or vice versa. Attempting to
do this subclassing at runtime will raise a TypeError.
0 commit comments