New submission from Iurii Kemaev <y.kem...@gmail.com>:
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). ---------- components: Library (Lib) messages: 386695 nosy: hbq1 priority: normal pull_requests: 23278 severity: normal status: open title: Dataclasses derived from empty frozen bases skip immutability checks type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43176> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com