Skip to content

Add frozen_default parameter on dataclass_transform #99957

Closed

Description

@debonte

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

Activity

  1. added a commit that references this issue on Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions