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 jfuruness
Recipients eric.smith, jfuruness, josh.r
Date 2021-10-19.07:56:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
I didn't realize it was possible to add slots in that way (slots=True). I
think for normal classes manually defining __slots__ is the common way of
adding __slots__ (at least for me), so it feels weird to me that manually
defining __slots__ instead of adding slots=True produces different
behaviour. That being said, no strong motivation to change it, this fixes
my issue, feel free to close this.


On Mon, Oct 18, 2021 at 9:25 PM Josh Rosenberg <>

> Josh Rosenberg <> added the comment:
> When I define this with the new-in-3.10 slots=True argument to dataclass
> rather than manually defining __slots__ it works just fine. Looks like the
> pickle format changes rather dramatically to accommodate it.
> >>> @dataclass(frozen=True, slots=True)
> ... class FrozenData:
> ...     my_string: str
> ...
> >>> deepcopy(FrozenData('initial'))
> FrozenData(my_string='initial')
> Is there a strong motivation to support manually defined __slots__ on top
> of slots=True that warrants fixing it for 3.10 onward?
> ----------
> nosy: +josh.r
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2021-10-19 07:56:45jfurunesssetrecipients: + jfuruness, eric.smith, josh.r
2021-10-19 07:56:45jfurunesslinkissue45520 messages
2021-10-19 07:56:45jfurunesscreate