Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frozen_default parameter on dataclass_transform #99957

Closed
debonte opened this issue Dec 2, 2022 · 0 comments · Fixed by #99958
Closed

Add frozen_default parameter on dataclass_transform #99957

debonte opened this issue Dec 2, 2022 · 0 comments · Fixed by #99958
Labels
type-feature A feature request or enhancement

Comments

@debonte
Copy link
Contributor

debonte commented Dec 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant