Skip to content

gh-144618: Don't track ClassVar dataclass members as defaults#144619

Open
johnslavik wants to merge 6 commits intopython:mainfrom
johnslavik:dont-track-classvar-members-as-defaults
Open

gh-144618: Don't track ClassVar dataclass members as defaults#144619
johnslavik wants to merge 6 commits intopython:mainfrom
johnslavik:dont-track-classvar-members-as-defaults

Conversation

@johnslavik
Copy link
Member

@johnslavik johnslavik commented Feb 9, 2026

I haven't added code for cleaning up ClassVar[Field] = dataclasses.field(default=MISSING) from class members, because this is an incorrect use of the API.
Perhaps it should even fail, but that's out of scope of the issue.

@johnslavik johnslavik marked this pull request as ready for review February 9, 2026 05:05
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think: which parts of 3rd party libs this can potentially affect? Like pydantic validation / etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants