Skip to content

Commit 6354f1a

Browse files
committed
Update documentation on excluded headers in Python.h
1 parent f575588 commit 6354f1a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Doc/extending/extending.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ the module and a copyright notice if you like).
7575
See :ref:`arg-parsing-string-and-buffers` for a description of this macro.
7676

7777
All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
78-
``PY``, except those defined in standard header files. For convenience, and
79-
since they are used extensively by the Python interpreter, ``"Python.h"``
80-
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
81-
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
82-
your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
83-
:c:func:`realloc` directly.
78+
``PY``, except those defined in standard header files.
79+
80+
Note that :file:`Python.h` excludes ``<stdio.h>``, ``<string.h>``, ``<errno.h>``, and ``<stdlib.h>`` as they are not used by
81+
Python anymore. For backward compatibility of existing third party C extensions, they will
82+
be included if Py_LIMITED_API is not defined and for limited C API version 3.10 and older.
83+
The ``<ctype.h>`` and ``<unistd.h>`` headers are also not included for limited C API version 3.13 and newer.
84+
8485

8586
The next thing we add to our module file is the C function that will be called
8687
when the Python expression ``spam.system(string)`` is evaluated (we'll see

0 commit comments

Comments
 (0)