This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gianni
Recipients gianni
Date 2021-07-19.14:06:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
In-reply-to
Content
Using a frozendict as a default value should not cause an error in dataclasses. The check for mutability is:

   isinstance(f.default, (list, dict, set))

It appears frozendict has been changed to have a dict base class and it now raises an exception.

There should be a way to indicate object mutability as the purpose of the isinstance(f.default, (list, dict, set)) check is for mutable default values.

Using default_factory to work around this issue is cumbersome.
History
Date User Action Args
2021-07-19 14:06:32giannisetrecipients: + gianni
2021-07-19 14:06:32giannisetmessageid: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org>
2021-07-19 14:06:32giannilinkissue44674 messages
2021-07-19 14:06:32giannicreate