GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible by JelleZijlstra · Pull Request #136893 · python/cpython Conversation
|
|
Relying on the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
While far from ideal, this mitigation feels like a better state to leave things in while we ponder the possibilities for a cleaner solution.
Suggested tweaks inline to make it clearer that it's only del cls.__dict__ that needs the mapping proxy bypass.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Alyssa Coghlan <[email protected]>
There was an error while loading. Please reload this page.
|
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…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 <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
|
GH-136960 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…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 <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
…places a dataclass, make the original class collectible (pythonGH-136893) (python#136960)" This reverts commit 6e1b31b. Modifying the `__dict__` is likely to cause crashes
…lass, make the original class collectible (python#136893)" This reverts commit 46cbdf9.
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
…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 <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]>
* Fix slotted reference cycles on 3.14 Ref python/cpython#136893 & python/cpython#135228 Co-authored-by: Jelle Zijlstra <[email protected]> * Add news fragment * Bump version tag to CMA Co-authored-by: Brandt Bucher <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> * Apply review comment #1446 (comment) * EAFP --------- Co-authored-by: Jelle Zijlstra <[email protected]>
…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 <[email protected]>
…lass, make the original class collectible (python#136893)" (python#137014) This reverts commit 46cbdf9.
…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 <[email protected]>
…lass, make the original class collectible (python#136893)" (python#137014) This reverts commit 46cbdf9.
…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 <[email protected]> Co-authored-by: Alyssa Coghlan <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.