Skip to content

gh-107954: Document PEP 741 in What's New 3.14 #127056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Python Initialization Configuration
***********************************

.. _pyconfig_api:

PyConfig C API
==============

Expand Down Expand Up @@ -1592,6 +1594,8 @@ The ``__PYVENV_LAUNCHER__`` environment variable is used to set
:c:member:`PyConfig.base_executable`.


.. _pyinitconfig_api:

PyInitConfig C API
==================

Expand Down
36 changes: 36 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Summary -- release highlights

.. PEP-sized items next.

* :ref:`PEP 649: deferred evaluation of annotations <whatsnew314-pep649>`
* :ref:`PEP 741: Python Configuration C API <whatsnew314-pep741>`


New features
Expand Down Expand Up @@ -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 <pyinitconfig_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 <pyconfig_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
======================

Expand Down
Loading