Feature or enhancement
Add a new frozen_default parameter to dataclass_transform similar to the existing eq_default and order_default parameters.
Pitch
- Frozen dataclasses are very popular when working with Jax (
flax.struct.dataclass and tjax.dataclass), so being able to indicate that they are frozen by default would improve the user experience.
dataclass_transform is currently supported by Pyright/Pylance and Pyre. Both teams are in favor of implementing this new parameter. Since dataclass_transform supports kwargs for experimentation/extensibility, Pyright was already able to add support for frozen_default.
- All feedback on typing-sig has been in favor of this enhancement.
Previous discussion
Discussed in typing-sig.
Linked PRs