Sorry, something went wrong.
Sorry, something went wrong.
|
TODO: once we reach an consensus on the API, I will document the API. |
Sorry, something went wrong.
|
I documented the API. I decided to add a new Doc/c-api/config.rst documentation for that. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you!
Now that I see all the docs, it looks the design is missing a function: https://discuss.python.org/t/fr-allow-private-runtime-config-to-enable-extending-without-breaking-the-pyconfig-abi/18004/49?u=encukou
I also have a few docs nitpicks. I didn't look very closely at the implementation yet.
Sorry, something went wrong.
| Return ``-1`` if Python wants to exit and on error. Call | ||
| :c:func:`Py_ExitWithInitConfig` in this case. |
There was a problem hiding this comment.
What happens if you don't call it? (If it needs to be called, why does Py_InitializeFromInitConfig not call it itself?)
Sorry, something went wrong.
There was a problem hiding this comment.
The idea is to let the caller decide how to handle an error or an exit code. When you embed Python, you may not want the process to exit. It's a similar design than Py_InitializeFromConfig() and the PyStatus C API.
What happens if you don't call it?
Python is in an undefined state. The error/exit code stays in PyInitConfig. It's safer to handle the init error :-)
Sorry, something went wrong.
|
This change is quite big, so I moved PyConfig_Get() API to a separated PR: PR #112609. |
Sorry, something went wrong.
|
This API is kind of complicated (there are multiple use cases). I created PR #112609 as a starting point, just to add two functions. But apparently, adding PyConfig_Get() and PyConfig_GetInt() functions is more complicated than what I expected. I don't have the bandwidth to deal with such large API for now, so I prefer to close the PR. See also my comment on the PyConfig_Get() PR. |
Sorry, something went wrong.
Add PyInitConfig functions:
Add also functions using it:
Changes:
Discussion: https://discuss.python.org/t/fr-allow-private-runtime-config-to-enable-extending-without-breaking-the-pyconfig-abi/18004/20