[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

Eric Snow report at bugs.python.org
Mon Feb 25 20:03:59 EST 2019


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

@Armin, thanks for fixing things on your end so quickly. :)

Adding PyInterpreterState.dict and a public getter function (a la PyThreadState) is probably fine.  I'm just not sure how that relates to the problem with cffi's use of the "builtins" field.  If it would be useful in general then feel free to open a separate issue.  I doubt there'd be much opposition if you presented a decent use case, since the cost would be low.

In the case of PyInterpreterState.builtins specifically, if you need it we could add a simple PyInterpreterState_GetBuiltins().  However, couldn't you already use existing public API, e.g. `PyEval_GetBuiltins()` or `PyImport_GetModule("builtins")`?  Regardless, we certainly don't want to put anyone in a position that they must define Py_BUILD_CORE just for access to PyInterpreterState fields.

----------

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


More information about the Python-bugs-list mailing list