gh-135552: Add tests that check if weakref for tp_subclasses cleared after finalization#136304
Merged
nascheme merged 13 commits intopython:mainfrom Aug 8, 2025
Conversation
Contributor
Author
|
I believe this PR should skip news |
neonene
reviewed
Jul 4, 2025
Member
|
This looks okay to me. Some suggested improvements. The new test might fit better into I don't think it's required to run these in a separate Python process. That makes the test run slower and it's not supposed to crash. Generally a separate process is used for the tests that exercise the interpreter shutdown logic and we are not testing that. So you could just do: I find the variable naming a bit esoteric. I would have just called them |
Contributor
Author
|
@nascheme Thanks for review! Fixed. |
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Contributor
Author
|
@kumaraditya303 Thanks for review! |
Types are not treated specially, it only matters if the weakref has a callback or not.
Contributor
Author
|
Thanks everyone! |
Agent-Hellboy
pushed a commit
to Agent-Hellboy/cpython
that referenced
this pull request
Aug 19, 2025
These are tests to ensure behaviour introduced by pythonGH-136189 is working as expected. Co-authored-by: Mikhail Borisov <43937008+fxeqxmulfx@users.noreply.github.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests for #136189