diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-04-13 01:46:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 01:46:21 (GMT) |
commit | c88feceb449d6e85d7e17ec36559206094d10d81 (patch) | |
tree | cda7737ab74c0419b952e440b86e10a6101e3d7f /Doc/c-api/intro.rst | |
parent | a304b136adda3575898d8b5debedcd48d5072272 (diff) | |
download | cpython-c88feceb449d6e85d7e17ec36559206094d10d81.zip cpython-c88feceb449d6e85d7e17ec36559206094d10d81.tar.gz cpython-c88feceb449d6e85d7e17ec36559206094d10d81.tar.bz2 |
Doc: define PY_SSIZE_T_CLEAN always (GH-12794)
Diffstat (limited to 'Doc/c-api/intro.rst')
-rw-r--r-- | Doc/c-api/intro.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index 6bb2356..69aef0d 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -48,7 +48,8 @@ Include Files All function, type and macro definitions needed to use the Python/C API are included in your code by the following line:: - #include "Python.h" + #define PY_SSIZE_T_CLEAN + #include <Python.h> This implies inclusion of the following standard headers: ``<stdio.h>``, ``<string.h>``, ``<errno.h>``, ``<limits.h>``, ``<assert.h>`` and ``<stdlib.h>`` @@ -60,6 +61,9 @@ This implies inclusion of the following standard headers: ``<stdio.h>``, headers on some systems, you *must* include :file:`Python.h` before any standard headers are included. + It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including + ``Python.h``. See :ref:`arg-parsing` for a description of this macro. + All user visible names defined by Python.h (except those defined by the included standard headers) have one of the prefixes ``Py`` or ``_Py``. Names beginning with ``_Py`` are for internal use by the Python implementation and should not be |