SIGN IN SIGN UP

[3.14] gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (GH-136893) (#136960)

gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (GH-136893)

An interesting hack, but more localized in scope than GH-135230.

This may be a breaking change if people intentionally keep the original class around
when using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on the
original class.
(cherry picked from commit 46cbdf967ada11b0286060488b61635fd6a2bb23)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
M
Miss Islington (bot) committed
6e1b31b87e7a42c7911b517b78fc418217e6480c
Parent: caef946
Committed by GitHub <noreply@github.com> on 7/22/2025, 5:08:15 AM