Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_PyFrame_GetState is misnamed and does more than it needs to #108991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iritkatriel opened this issue Sep 6, 2023 · 0 comments · Fixed by #108992
Closed

_PyFrame_GetState is misnamed and does more than it needs to #108991

iritkatriel opened this issue Sep 6, 2023 · 0 comments · Fixed by #108992
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@iritkatriel
Copy link
Member

iritkatriel commented Sep 6, 2023

_PyFrame_GetState is a static function so can be renamed to reflect that.

More importantly, it calculates a lot more than what it is actually used for (it is called in two places, each of which checks for one of the states: CLEARED or SUSPENDED). The rest is neither used nor tested.

Some of the other states that this function checks for depend on the opcode at prev_instr, which is going to be replaced soon by instr_ptr. If we want to keep this function working we need to first cover all the states by tests. But there is no point doing this for code which is unused.

So I will replace this function by two simpler functions for the two existing use cases: checking if the frame is in CLEARED or SUSPENDED state.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant