diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index 35dc01e196e777e..834aae9372fe3bd 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -428,9 +428,7 @@ API Functions The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:expr:`const char * const *` in C++. - This can be overridden by defining the macro :c:macro:`PY_CXX_CONST` - before including :file:`Python.h` as ``const`` for the latter and as - empty value for the former. + This can be overridden with the :c:macro:`PY_CXX_CONST` macro. .. versionchanged:: 3.6 Added support for :ref:`positional-only parameters @@ -516,6 +514,19 @@ API Functions PyArg_ParseTuple(args, "O|O:ref", &object, &callback) +.. c:macro:: PY_CXX_CONST + + The value to be inserted, if any, before :c:expr:`char * const *` + in the *keywords* parameter declaration of + :c:func:`PyArg_ParseTupleAndKeywords` and + :c:func:`PyArg_VaParseTupleAndKeywords`. + Default empty for C and ``const`` for C++ + (:c:expr:`const char * const *`). + To override, define it to the desired value before including + :file:`Python.h`. + + .. versionadded:: 3.13 + --------------- Building values diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 6127ea7eff0617b..8eede2421c6b7db 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1107,13 +1107,11 @@ New Features * The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:func:`PyArg_VaParseTupleAndKeywords` has now type :c:expr:`char * const *` in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. - It makes these functions compatible with argument of type + It makes these functions compatible with arguments of type :c:expr:`const char * const *`, :c:expr:`const char **` or :c:expr:`char * const *` in C++ and :c:expr:`char * const *` in C - without explicit type cast. - This can be overridden by defining the macro ``PY_CXX_CONST`` - before including :file:`Python.h` as ``const`` for the latter and as - empty value for the former. + without an explicit type cast. + This can be overridden with the :c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy Storchaka in :gh:`65210`.) * Add :c:func:`PyImport_AddModuleRef`: similar to