Skip to content

[3.7] bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (GH-6147)#6148

Merged
ericvsmith merged 1 commit into
python:3.7from
miss-islington:backport-f199bc6-3.7
Mar 19, 2018
Merged

[3.7] bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (GH-6147)#6148
ericvsmith merged 1 commit into
python:3.7from
miss-islington:backport-f199bc6-3.7

Conversation

@miss-islington

@miss-islington miss-islington commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

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.
(cherry picked from commit f199bc6)

Co-authored-by: Eric V. Smith ericvsmith@users.noreply.github.com

https://bugs.python.org/issue32953

…ass derived classes (pythonGH-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.
(cherry picked from commit f199bc6)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@ericvsmith: Backport status check is done, and it's a success ✅ .

@ericvsmith
ericvsmith merged commit 4564831 into python:3.7 Mar 19, 2018
@miss-islington

Copy link
Copy Markdown
Contributor Author

Thanks, @ericvsmith!

@miss-islington
miss-islington deleted the backport-f199bc6-3.7 branch March 19, 2018 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants