gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible by JelleZijlstra · Pull Request #136893 · python/cpython
…ke the original class collectible An interesting hack, but more localized in scope than python#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.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
…ke the original class collectible (pythonGH-136893) An interesting hack, but more localized in scope than pythonGH-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 46cbdf9) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
JelleZijlstra added a commit that referenced this pull request
…ake 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 46cbdf9) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
hynek
mentioned this pull request
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request
…ke the original class collectible (python#136893) An interesting hack, but more localized in scope than python#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. Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
github-merge-queue Bot pushed a commit to python-attrs/attrs that referenced this pull request
* Fix slotted reference cycles on 3.14 Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com> * Add news fragment * Bump version tag to CMA Co-authored-by: Brandt Bucher <40968415+brandtbucher@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com> * Apply review comment #1446 (comment) * EAFP --------- Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request
…ke the original class collectible (python#136893) An interesting hack, but more localized in scope than python#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. Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request
…ke the original class collectible (python#136893) An interesting hack, but more localized in scope than python#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. Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request
…ass, make the original class collectible (pythonGH-136893) (python#136960) pythongh-135228: When @DataClass(slots=True) replaces a dataclass, make the original class collectible (pythonGH-136893) An interesting hack, but more localized in scope than pythonGH-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 46cbdf9) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>