[New-bugs-announce] [issue33474] Support immutability per-field in dataclasses

Daniel Lindeman report at bugs.python.org
Sat May 12 17:28:57 EDT 2018


New submission from Daniel Lindeman <lindemda at gmail.com>:

Currently, all fields in dataclasses can be frozen by passing frozen=True to the decorator. There are cases where it would be useful to have some fields be mutable, and others immutable. By using a strategy similar to how the decorator frozen works, using __setattr__ and __delattr__, it would be possible to support immutability per-field. This could perhaps be done by adding a frozen argument to the field constructor.

----------
messages: 316438
nosy: Daniel Lindeman, eric.smith
priority: normal
severity: normal
status: open
title: Support immutability per-field in dataclasses
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33474>
_______________________________________


More information about the New-bugs-announce mailing list