You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Py_NewInterpreterFromConfig() and PyInterpreterConfig to the Public API #98733
In gh-98609 we added _Py_NewInterpreterFromConfig() and the _PyInterpreterConfig struct. We should consider adding them to the public API:
drop the leading underscore from the names
add entries to Docs/c-api/init.rst
This isn't an urgent need, since the API is unlikely to be in high demand. However, currently there isn't any way for users to currently configure a new interpreter (via Py_NewInterpreter()). This function will give them a supported way. Furthermore, PEP 684 ("A Per-Interpreter GIL") will likely specify that the two will be added to the public API.
The only question is if Py_NewInterpreterFromConfig() and PyInterpreterConfig are an appropriate (I hesitate to say "best") API for users. I think it is, given the simplicity, how easy it will be to add more settings in the future, and the parallel with Py_InitializeFromConfig()/PyConfig.
Note that, in gh-98609, we also added PyInterpreterState.feature_flags, several flag constants (Py_RTFLAGS_*), and _PyInterpreterState_HasFeature(). Since the "features" are administrated internally, there is little need to add those to the public API. We can always add them later if there's an actual need.
Activity
ericsnowcurrently commentedon Oct 26, 2022
Note that, in gh-98609, we also added
PyInterpreterState.feature_flags, several flag constants (Py_RTFLAGS_*), and_PyInterpreterState_HasFeature(). Since the "features" are administrated internally, there is little need to add those to the public API. We can always add them later if there's an actual need.nanjekyejoannah commentedon Oct 9, 2023
The APIs are now public, closing the issue.