Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Nov 19, 2025

The dataclasses __init__ function is generated dynamically by a call to exec() and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances.
(cherry picked from commit ce79154)

Co-authored-by: Edward Xu [email protected]

…issue (pythongh-141596)

The dataclasses `__init__` function is generated dynamically by a call to `exec()` and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances.
(cherry picked from commit ce79154)

Co-authored-by: Edward Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants