[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

STINNER Victor report at bugs.python.org
Tue Mar 22 10:47:09 EDT 2022


STINNER Victor <vstinner at python.org> added the comment:

> In Python 3.10, it's possible to call PyFrame_FastToLocalsWithError() on a frame to get all variables as a dictionary.

In 2018, it was decided to *not* document this function: see bpo-19431.

In C, It is possible to call PyObject_GetAttrString(frame, "f_locals") to call indirectly _PyFrame_FastToLocalsWithError() and get the dictionary.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47092>
_______________________________________


More information about the Python-bugs-list mailing list