It's in the Limited API since v3.13. Not too different from PyEval_GetBuiltins(), which is deprecated.
I think that following should work in v3.10+:
PyObject * PyEval_GetFrameBuiltins(void) { return Py_XNewRef(PyEval_GetBuiltins()); }
Add PyEval_GetFrameBuiltins()
I didn't notice the 3 new functions of PEP 667. I added PyEval_GetFrameLocals(), PyEval_GetFrameGlobals() and PyEval_GetFrameBuiltins() functions with #200.
The new functions return a strong reference, instead of a borrowed reference.
I also completed the list of "not supported" functions: b0feca0. I was surprised that PyEval_GetFrameBuiltins() wasn't in this list before I added it.
Activity
Add PyEval_GetFrameBuiltins()
vstinner commented on Oct 12, 2026
I didn't notice the 3 new functions of PEP 667. I added PyEval_GetFrameLocals(), PyEval_GetFrameGlobals() and PyEval_GetFrameBuiltins() functions with #200.
The new functions return a strong reference, instead of a borrowed reference.
vstinner commented on Oct 12, 2026
I also completed the list of "not supported" functions: b0feca0. I was surprised that PyEval_GetFrameBuiltins() wasn't in this list before I added it.