gh-111354: remove comparisons with enum values, variable reuse, unused imports in genobject.c#111708
Merged
iritkatriel merged 9 commits intopython:mainfrom Nov 9, 2023
Merged
gh-111354: remove comparisons with enum values, variable reuse, unused imports in genobject.c#111708iritkatriel merged 9 commits intopython:mainfrom
iritkatriel merged 9 commits intopython:mainfrom
Conversation
markshannon
reviewed
Nov 6, 2023
| /* Push arg onto the frame's value stack */ | ||
| result = arg ? arg : Py_None; | ||
| _PyFrame_StackPush(frame, Py_NewRef(result)); | ||
| PyObject *arg_obj = arg ? arg : Py_None; |
Member
There was a problem hiding this comment.
Would it make sense to require arg to be not NULL? This is a static function, so we know all the callers.
(Not necessarily in this PR, though)
Include/internal/pycore_frame.h
Outdated
| } PyFrameState; | ||
|
|
||
| #define FRAME_STATE_SUSPENDED(S) ((S) == FRAME_SUSPENDED || (S) == FRAME_SUSPENDED_YIELD_FROM) | ||
| #define FRAME_STATE_CLOSED(S) ((S) >= FRAME_COMPLETED) |
Member
There was a problem hiding this comment.
Does the state being FRAME_COMPLETED mean that it is closed?
Can't it be completed, but not closed?
Member
Author
There was a problem hiding this comment.
There is no CLOSED state. There is COMPLETED and CLEARED. CLOSED is a new category of both. Maybe FINISHED is a better name for this.
markshannon
approved these changes
Nov 9, 2023
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
… unused imports in genobject.c (python#111708)
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
… unused imports in genobject.c (python#111708)
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.
Tidies up genobject.c:
resultvariable for theargReviewing individual commits might be easier.