gh-131740: minor readability fix in PyUnstable_GC_VisitObjects#131786
Merged
corona10 merged 2 commits intopython:mainfrom Mar 28, 2025
Merged
gh-131740: minor readability fix in PyUnstable_GC_VisitObjects#131786corona10 merged 2 commits intopython:mainfrom
corona10 merged 2 commits intopython:mainfrom
Conversation
Replaces `if (visit_generation())` with `if (visit_generation() < 0)`, since we are checking for the failure case, and it's confusing to have that be implicitly `true`. Also fixes a misspelt variable name.
Member
|
I'm willing to accept that change (at least the typo fix) but let's ask @corona10 about this. The pattern for error checks is common. |
Member
|
Let's backport to 3.13, too; it's not a bug, but make it as consistent as possible. For 3.12, it's not worth doing that since we need to make a manual backport anyway due to different directory hiarchy. |
|
Thanks @martindemello for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Sorry, @martindemello and @corona10, I could not cleanly backport this to |
Member
|
Hmm let's skip backport to 3.13 also. It doesn't look like worth do it since we need to do manual backport. |
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.
Replaces
if (visit_generation())withif (visit_generation() < 0), since we are checking for the failure case, and it's confusing to have that be implicitlytrue.Also fixes a misspelt variable name.