diff options
author | Eric V. Smith <ericvsmith@users.noreply.github.com> | 2018-03-19 00:40:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 00:40:34 (GMT) |
commit | f199bc655eb50c28e94010714629b376bbbd077b (patch) | |
tree | 2f6d64470055592c9b7d1e27bda7cd4cc3804916 /Misc/NEWS.d | |
parent | 3fe33043ee83d19e15551094fc1e0984617ded3c (diff) | |
download | cpython-f199bc655eb50c28e94010714629b376bbbd077b.zip cpython-f199bc655eb50c28e94010714629b376bbbd077b.tar.gz cpython-f199bc655eb50c28e94010714629b376bbbd077b.tar.bz2 |
bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (#6147)
If a non-dataclass derives from a frozen dataclass, allow attributes to be set.
Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen.
Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r-- | Misc/NEWS.d/next/Library/2018-03-18-17-38-48.bpo-32953.t8WAWN.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2018-03-18-17-38-48.bpo-32953.t8WAWN.rst b/Misc/NEWS.d/next/Library/2018-03-18-17-38-48.bpo-32953.t8WAWN.rst new file mode 100644 index 0000000..fbea34a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-03-18-17-38-48.bpo-32953.t8WAWN.rst @@ -0,0 +1,4 @@ +If a non-dataclass inherits from a frozen dataclass, allow attributes to be +added to the derived class. Only attributes from from the frozen dataclass +cannot be assigned to. Require all dataclasses in a hierarchy to be either +all frozen or all non-frozen. |