You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_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.
Uh oh!
There was an error while loading. Please reload this page.
_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 byinstr_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
The text was updated successfully, but these errors were encountered: