From 4266d92606bcbf54ea8ecc7b8f1e254ccf36d580 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 28 Feb 2025 15:06:35 +0100 Subject: [PATCH 1/3] C API: mention the workgroup, and the need to be stricter than our public promises --- developer-workflow/c-api.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/developer-workflow/c-api.rst b/developer-workflow/c-api.rst index 3f8c03e92..d1f8a857b 100644 --- a/developer-workflow/c-api.rst +++ b/developer-workflow/c-api.rst @@ -19,8 +19,13 @@ The C API is divided into these tiers: Each tier has different stability and maintenance requirements to consider when you add or change definitions in it. -The compatibility guarantees for public C API are explained in the -user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`). +The public backwards compatibility guarantees for public C API are explained +in the user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`). +C language compatibility guarantees are is in ``Doc/c-api/intro.rst`` +(:ref:`python:api-intro`). + +Internally, we need to be more careful about compatibility than what we promise +publicly. See :ref:`public-capi` for details. The internal API @@ -93,6 +98,17 @@ CPython's public C API is available when ``Python.h`` is included normally It should be defined in ``Include/cpython/`` (unless part of the Limited API, see below). +Before adding new public API, please ask in the `decisions repo`_ of +the :pep:`C API workgroup <731>`. +This helps us ensure *newly added* API is consistent and maintainable. + +Also check with the C API WG before requiring a C feature not present in C99. +While the *public* docs only promise compatibility with C11, in practice +we only intruduce C11 features individually as needed. + +.. _decisions repo: https://github.com/capi-workgroup/decisions/issues + + .. _public-api-guidelines: Guidelines for expanding/changing the public API From 1f33341e8ccda96cd04e089e8801b758a41bfc43 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 28 Feb 2025 15:24:43 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- developer-workflow/c-api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-workflow/c-api.rst b/developer-workflow/c-api.rst index d1f8a857b..f7c6aacd8 100644 --- a/developer-workflow/c-api.rst +++ b/developer-workflow/c-api.rst @@ -21,7 +21,7 @@ when you add or change definitions in it. The public backwards compatibility guarantees for public C API are explained in the user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`). -C language compatibility guarantees are is in ``Doc/c-api/intro.rst`` +C language compatibility guarantees are in ``Doc/c-api/intro.rst`` (:ref:`python:api-intro`). Internally, we need to be more careful about compatibility than what we promise From bfd53d6db0cda84490e8338e27d520e7afee1fec Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 10 Mar 2025 15:07:45 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Clarify:=20Internally=E2=86=92as=20core=20d?= =?UTF-8?q?evs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- developer-workflow/c-api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer-workflow/c-api.rst b/developer-workflow/c-api.rst index f7c6aacd8..90c1d12e4 100644 --- a/developer-workflow/c-api.rst +++ b/developer-workflow/c-api.rst @@ -24,8 +24,8 @@ in the user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`). C language compatibility guarantees are in ``Doc/c-api/intro.rst`` (:ref:`python:api-intro`). -Internally, we need to be more careful about compatibility than what we promise -publicly. See :ref:`public-capi` for details. +As core developers, we need to be more careful about compatibility than what +we promise publicly. See :ref:`public-capi` for details. The internal API