-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Allow the f_func
field of the _PyInterpreterFrame
struct to be any object (and rename it)
#96237
Comments
Does it really need to allow any object? Could you instead define a small number of object types that it can be? |
I don't see any advantage to restricting the possible types. Allowing any object is no worse for any code reading from Given the values of |
Currently whatever is in |
Should this issue be closed, given the attached PR was merged? Or is there more planned here? |
Superseded by #100987 |
In order to better support shim frames, trampolines, Cython frames and other such bits and pieces, we need to relax the requirement that the
f_func
field is a function.The only reason for it to be a function is that it needs to hold a strong reference to builtins and globals, as the frame only has a borrowed reference to those. Any object with those references will do.
In fact, for code that has no builtins or globals (many shims and trampolines) there is no need for those references and
f_func
could even beNone
.The text was updated successfully, but these errors were encountered: