From 796b17b22258170b6621f7140d7a1be1d8cdbef8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 20 Nov 2024 12:06:00 +0100 Subject: [PATCH] gh-107954: Document PEP 741 in What's New 3.14 --- Doc/c-api/init_config.rst | 4 ++++ Doc/whatsnew/3.14.rst | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 6194d7446c73e4..e621545cffcee3 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -6,6 +6,8 @@ Python Initialization Configuration *********************************** +.. _pyconfig_api: + PyConfig C API ============== @@ -1592,6 +1594,8 @@ The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:`PyConfig.base_executable`. +.. _pyinitconfig_api: + PyInitConfig C API ================== diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 53b22094e8abf1..57ff12faf5917f 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -65,6 +65,8 @@ Summary -- release highlights .. PEP-sized items next. +* :ref:`PEP 649: deferred evaluation of annotations ` +* :ref:`PEP 741: Python Configuration C API ` New features @@ -172,6 +174,40 @@ Improved error messages ValueError: too many values to unpack (expected 3, got 4) +.. _whatsnew314-pep741: + +PEP 741: Python Configuration C API +----------------------------------- + +Add a :ref:`PyInitConfig C API ` to configure the Python +initialization without relying on C structures and the ability to make +ABI-compatible changes in the future. + +Complete the :pep:`587` :ref:`PyConfig C API ` by adding +:c:func:`PyInitConfig_AddModule` which can be used to add a built-in extension +module; feature previously referred to as the “inittab”. + +Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and set +the current runtime configuration. + +PEP 587 “Python Initialization Configuration” unified all the ways to configure +the Python initialization. This PEP unifies also the configuration of the +Python preinitialization and the Python initialization in a single API. +Moreover, this PEP only provides a single choice to embed Python, instead of +having two “Python” and “Isolated” choices (PEP 587), to simplify the API +further. + +The lower level PEP 587 PyConfig API remains available for use cases with an +intentionally higher level of coupling to CPython implementation details (such +as emulating the full functionality of CPython’s CLI, including its +configuration mechanisms). + +(Contributed by Victor Stinner in :gh:`107954`.) + +.. seealso:: + :pep:`741`. + + Other language changes ======================