Expose _Py_NewInterpreter() as Py_NewInterpreterFromConfig() #98608
Labels
3.12
expert-subinterpreters
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
ericsnowcurrently commentedOct 24, 2022
A while back I added
_Py_NewInterpreter()
(a "private" API) to support configuring the new interpreter. Ultimately, I'd like to adjustthe signature a little and then make the function part of the public API (as
Py_NewInterpreterFromConfig()
).My plan:
_PyInterpreterConfig
structPy_NewInterpreterFromConfig()
, inspired byPy_InitializeFromConfig()
(takes aPyInterpreterConfig
instead ofisolated_subinterpreter
)isolated_subinterpreter
into the corresponding multiple granular settingsPyConfig._isolated_interpreter
Note that the current default (
Py_NewInterpeter()
andPy_Initialize*()
) allows fork, subprocess, and threads, and the optional "isolated" interpreter disables all three. I'm not planning on changing any of that here.My main objective here is to expose the existing API in a way that we can do the following afterward:
PyInterpreterConfig.allow_subprocess
)The text was updated successfully, but these errors were encountered: