← 返回首页
Add `frozen_default` parameter on `dataclass_transform` · Issue #99957 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Add frozen_default parameter on dataclass_transform #99957

New issue
New issue

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.