Skip to content

__replace__ should be synthesized for dataclasses in 3.13 #8300

@max-muoto

Description

@max-muoto

Starting in Python 3.13, a dunder __replace__ is added onto all dataclasses instances that effectively replicates the previous module level dataclasses.replace. See here for the relevant cpython PR.

The same goes for named tuples, but I'm not sure how much of that's special-cased by type-checkers versus is just in type-checkers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions