Message 404260 - Python tracker
Message404260
| Author | josh.r |
|---|---|
| Recipients | eric.smith, jfuruness, josh.r |
| Date | 2021-10-19.01:25:42 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1634606742.71.0.91350377208.issue45520@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
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? |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2021-10-19 01:25:42 | josh.r | set | recipients: + josh.r, eric.smith, jfuruness |
| 2021-10-19 01:25:42 | josh.r | set | messageid: <1634606742.71.0.91350377208.issue45520@roundup.psfhosted.org> |
| 2021-10-19 01:25:42 | josh.r | link | issue45520 messages |
| 2021-10-19 01:25:42 | josh.r | create | |