Message386695
Dataclasses derived from empty frozen bases skip immutability checks.
Repro snippet:
```
import dataclasses
@dataclasses.dataclass(frozen=True)
class Base:
pass
@dataclasses.dataclass
class Derived(Base):
a: int
d = Derived(2)
# OK
```
Usecase: sometimes developers define an empty frozen base dataclass with detailed docs and require other dataclasses to inherit from it as a code contract to avoid accidental in-place modifications.
This bug makes this strategy ineffective.
Affects all versions of Python that support dataclasses (including the backport for py3.6). |
|
Date |
User |
Action |
Args |
2021-02-09 07:12:39 | hbq1 | set | recipients:
+ hbq1 |
2021-02-09 07:12:39 | hbq1 | set | messageid: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> |
2021-02-09 07:12:39 | hbq1 | link | issue43176 messages |
2021-02-09 07:12:39 | hbq1 | create | |
|