[docs] [issue37465] Incorrect documentation for `s#` arguments in C API argument parsing
report at bugs.python.org
Mon Jul 1 04:31:06 EDT 2019
Inada Naoki <songofacandy at gmail.com> added the comment:
See note in https://docs.python.org/3.9/c-api/arg.html#strings-and-buffers
Note: For all # variants of formats (s#, y#, etc.), the type of the length argument (int or Py_ssize_t) is controlled by defining the macro PY_SSIZE_T_CLEAN before including Python.h. If the macro was defined, length is a Py_ssize_t rather than an int. This behavior will change in a future Python version to only support Py_ssize_t and drop int support. It is best to always define PY_SSIZE_T_CLEAN.
Python tracker <report at bugs.python.org>
More information about the docs