gh-116946: fully implement GC protocol for _hashlib objects#138289
gh-116946: fully implement GC protocol for _hashlib objects#138289picnixz merged 3 commits intopython:mainfrom
_hashlib objects#138289Conversation
|
🤖 New build scheduled with the buildbot fleet by @gpshead for commit 23c4d91 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138289%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @picnixz, I could not cleanly backport this to |
…jects (pythonGH-138289) (cherry picked from commit 6f1dd95) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-138324 is a backport of this pull request to the 3.14 branch. |
…jects (pythonGH-138289) (cherry picked from commit 6f1dd95) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-138326 is a backport of this pull request to the 3.13 branch. |
…jects (pythonGH-138289) (cherry picked from commit 6f1dd95) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…jects (pythonGH-138289) (cherry picked from commit 6f1dd95) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…jects (pythonGH-138289) (cherry picked from commit 6f1dd95) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
@kumaraditya303 If the type is both immutable and disallows instantiation BUT can be inherited, should I still implement the GC protocol? If so, I need to only keep half of the PR. Otherwise I can fully revert it. |
No, the subclass would implement the GC protocol if it needs to, it is not needed for base type in this case as it is immutable and objects are empty. |
…bjects (python#138289)" This reverts commit 6f1dd95.
…hlib` objects (pythonGH-138289) (python#138326)" This reverts commit 21b5932.
…H-138322, GH-138323, GH-138326) (#138337) * Revert "[3.13] gh-116946: fully implement GC protocol for `bz2` objects (GH-138266) (#138322)" This reverts commit 90036f5. * Revert "[3.13] gh-116946: fully implement GC protocol for `lzma` objects (GH-138288) (#138323)" This reverts commit 828682d. * Revert "[3.13] gh-116946: fully implement GC protocol for `_hashlib` objects (GH-138289) (#138326)" This reverts commit 21b5932.
…, GH-138288, GH-138289) (#138338) * Revert "gh-116946: fully implement GC protocol for `bz2` objects (#138266)" This reverts commit 9be91f6. * Revert "gh-116946: fully implement GC protocol for `lzma` objects (#138288)" This reverts commit 3ea16f9. * Revert "gh-116946: fully implement GC protocol for `_hashlib` objects (#138289)" This reverts commit 6f1dd95.
…ythonGH-138266, pythonGH-138288, pythonGH-138289) (python#138338) * Revert "pythongh-116946: fully implement GC protocol for `bz2` objects (python#138266)" This reverts commit 9be91f6. * Revert "pythongh-116946: fully implement GC protocol for `lzma` objects (python#138288)" This reverts commit 3ea16f9. * Revert "pythongh-116946: fully implement GC protocol for `_hashlib` objects (python#138289)" This reverts commit 6f1dd95.
I noticed that
HASHXOFdidn't explicitly specify its deallocation function because HASHXOF is inherting HASH (it's constructed usingPyType_FromSpecWithBases).