]> granicus.if.org Git - python/commit
bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived...
authorEric V. Smith <ericvsmith@users.noreply.github.com>
Mon, 19 Mar 2018 00:40:34 +0000 (20:40 -0400)
committerGitHub <noreply@github.com>
Mon, 19 Mar 2018 00:40:34 +0000 (20:40 -0400)
commitf199bc655eb50c28e94010714629b376bbbd077b
tree2f6d64470055592c9b7d1e27bda7cd4cc3804916
parent3fe33043ee83d19e15551094fc1e0984617ded3c
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.
Lib/dataclasses.py
Lib/test/test_dataclasses.py
Misc/NEWS.d/next/Library/2018-03-18-17-38-48.bpo-32953.t8WAWN.rst [new file with mode: 0644]