Skip to content

Conversation

@decorator-factory
Copy link
Contributor

@decorator-factory decorator-factory commented Dec 23, 2025

I was recently pointed to the fact that the typing documentation does in fact demand that dataclass_transforms support __replace__:

https://typing.python.org/en/latest/spec/dataclasses.html#the-dataclass-transform-decorator

Except where stated otherwise, classes impacted by dataclass_transform, either by inheriting from a class that is decorated with dataclass_transform or by being decorated with a function decorated with dataclass_transform, are assumed to behave like stdlib dataclass().

So the documentation I wrote was wrong: type checkers are supposed to assume that the dataclass_transform produces classes with __replace__ support in 3.13+.

@DetachHead DetachHead merged commit 6c2a199 into DetachHead:main Dec 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants