Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/howto/clinic.rst
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
vstinner and AlexWaygood authored Aug 29, 2023
commit 60ec4ec77c6cfe8f3e28bcf4dfad42eb34ba2e5e
11 changes: 7 additions & 4 deletions Doc/howto/clinic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1915,10 +1915,13 @@ blocks embedded in Python files look slightly different. They look like this:
How to use the Limited C API
Comment thread
vstinner marked this conversation as resolved.
----------------------------

If a C source code contains ``#define Py_LIMITED_API``, the generated C code
will use the :ref:`Limited API <limited-c-api>` to parse arguments. Private
functions are not used in this case. However, the code parsing arguments can be
less efficient depending on the parameters (types, number, etc.).
If Argument Clinic :term:`input` is located within a C source file
that contains ``#define Py_LIMITED_API``, Argument Clinic will generate C code
that uses the :ref:`Limited API <limited-c-api>` to parse arguments. The
advantage of this is that the generated code will not use private functions.
However, this *can* result in Argument Clinic generating less efficient code
in some cases. The extent of the performance penalty will depend
on the parameters (types, number, etc.).

.. versionadded:: 3.13

Expand Down