Doc: define PY_SSIZE_T_CLEAN always (GH-12794)

This commit is contained in:
Inada Naoki 2019-04-13 10:46:21 +09:00 committed by GitHub
parent a304b136ad
commit c88feceb44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 4 deletions

View file

@ -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