-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Replace _PyFrame_OpAlreadyRan by a check for incomplete frame #109176
Comments
Here's a demonstration of the (unlikely?) case for which def spam(a, b, c):
def eggs():
return a, b, c
return eggs
args = (1, 2, 3)
eggs1 = spam(*args)
print(eggs1.__closure__)
assert all(v is c.cell_contents for v, c in zip(args, eggs1.__closure__))
args = eggs1.__closure__
eggs2 = spam(*args)
print(eggs2.__closure__)
assert all(c not in eggs2.__closure__ for c in args)
assert all(v is c.cell_contents for v, c in zip(args, eggs2.__closure__)) However, this only needs @markshannon, could you verify that the eval loop can't be interrupted before all |
Regardless, it would make sense to add a test that does something like the code I posted above. |
There could perhaps also be a pure C example. |
Yeah, and a pure-python test that uses a tracing hook to interrupt the code as early as possible. I suppose the same is true for a test that triggers the eval breaker as early as possible. |
Changed the title to reflect the decision in the discussion beginning with faster-cpython/ideas#623 (comment). |
…ame is complete. Pretend that cells are not set in an incomplete frame
@markshannon points out that this frame cannot be incomplete because it comes from a PyFrameObject (in PyFrame_GetVar). So we will just replace the check by an assertion. |
…he frame is complete. (python#119234)
The
_PyFrame_OpAlreadyRan
function in frameobject.c is not covered by any tests.For details see faster-cpython/ideas#623.
Linked PRs
The text was updated successfully, but these errors were encountered: