@@ -152,7 +152,7 @@ process a single source file, like this:
152
152
The CLI supports the following options:
153
153
154
154
.. program :: ./Tools/clinic/clinic.py [-h] [-f] [-o OUTPUT] [-v] \
155
- [--converters] [--make] [--srcdir SRCDIR] [FILE ...]
155
+ [--converters] [--make] [--srcdir SRCDIR] [--limited] [ FILE ...]
156
156
157
157
.. option :: -h , --help
158
158
@@ -187,6 +187,11 @@ The CLI supports the following options:
187
187
A file to exclude in :option: `--make ` mode.
188
188
This option can be given multiple times.
189
189
190
+ .. option :: --limited
191
+
192
+ Use the :ref: `Limited API <limited-c-api >` to parse arguments in the generated C code.
193
+ See :ref: `clinic-howto-limited-capi `.
194
+
190
195
.. option :: FILE ...
191
196
192
197
The list of files to process.
@@ -1899,6 +1904,22 @@ blocks embedded in Python files look slightly different. They look like this:
1899
1904
#/*[python checksum:...]*/
1900
1905
1901
1906
1907
+ .. _clinic-howto-limited-capi :
1908
+
1909
+ How to use the Limited C API
1910
+ ----------------------------
1911
+
1912
+ If Argument Clinic :term: `input ` is located within a C source file
1913
+ that contains ``#define Py_LIMITED_API ``, Argument Clinic will generate C code
1914
+ that uses the :ref: `Limited API <limited-c-api >` to parse arguments. The
1915
+ advantage of this is that the generated code will not use private functions.
1916
+ However, this *can * result in Argument Clinic generating less efficient code
1917
+ in some cases. The extent of the performance penalty will depend
1918
+ on the parameters (types, number, etc.).
1919
+
1920
+ .. versionadded :: 3.13
1921
+
1922
+
1902
1923
.. _clinic-howto-override-signature :
1903
1924
1904
1925
How to override the generated signature
0 commit comments