From 6354f1a3b40363dae4a81a8786af771ee51f5d30 Mon Sep 17 00:00:00 2001 From: Sina Zel taat Date: Sat, 19 Jul 2025 16:23:16 +0200 Subject: [PATCH 1/3] Update documentation on excluded headers in Python.h --- Doc/extending/extending.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index fd63495674651b..09c59dab59db97 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -75,12 +75,13 @@ the module and a copyright notice if you like). See :ref:`arg-parsing-string-and-buffers` for a description of this macro. All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or -``PY``, except those defined in standard header files. For convenience, and -since they are used extensively by the Python interpreter, ``"Python.h"`` -includes a few standard header files: ````, ````, -````, and ````. If the latter header file does not exist on -your system, it declares the functions :c:func:`malloc`, :c:func:`free` and -:c:func:`realloc` directly. +``PY``, except those defined in standard header files. + +Note that :file:`Python.h` excludes ````, ````, ````, and ```` as they are not used by +Python anymore. For backward compatibility of existing third party C extensions, they will +be included if Py_LIMITED_API is not defined and for limited C API version 3.10 and older. +The ```` and ```` headers are also not included for limited C API version 3.13 and newer. + The next thing we add to our module file is the C function that will be called when the Python expression ``spam.system(string)`` is evaluated (we'll see From ea3c0132fe0a5f7ceca0a0b184784e9e6614b5c9 Mon Sep 17 00:00:00 2001 From: Sina Zel taat Date: Sat, 19 Jul 2025 17:14:56 +0200 Subject: [PATCH 2/3] fix line length. limit to 80 characters --- Doc/extending/extending.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 09c59dab59db97..facecd92e59af0 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -77,10 +77,13 @@ the module and a copyright notice if you like). All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or ``PY``, except those defined in standard header files. -Note that :file:`Python.h` excludes ````, ````, ````, and ```` as they are not used by -Python anymore. For backward compatibility of existing third party C extensions, they will -be included if Py_LIMITED_API is not defined and for limited C API version 3.10 and older. -The ```` and ```` headers are also not included for limited C API version 3.13 and newer. +Note that :file:`Python.h` excludes ````, ````, +````, and ```` as they are not used by Python anymore. +For backward compatibility of existing third party C extensions, they will be +included if Py_LIMITED_API is not defined and for limited C API version 3.10 +and older. +The ```` and ```` headers are also not included for limited +C API version 3.13 and newer. The next thing we add to our module file is the C function that will be called From 2cd4be1a14b31c52d6d5e4fad7a84165ce438e9e Mon Sep 17 00:00:00 2001 From: Sina Zel taat Date: Mon, 21 Jul 2025 18:00:03 +0200 Subject: [PATCH 3/3] apply suggestion from code review --- Doc/extending/extending.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index facecd92e59af0..2f07a4aa50f9f5 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -77,11 +77,9 @@ the module and a copyright notice if you like). All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or ``PY``, except those defined in standard header files. -Note that :file:`Python.h` excludes ````, ````, -````, and ```` as they are not used by Python anymore. -For backward compatibility of existing third party C extensions, they will be -included if Py_LIMITED_API is not defined and for limited C API version 3.10 -and older. +For backward compatibility of existing third party C extensions, :file:`Python.h` +includes ````, ````, ````, and ```` if +:c:macro:`Py_LIMITED_API` is not defined or for limited C API version 3.10 and older. The ```` and ```` headers are also not included for limited C API version 3.13 and newer. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy