Skip to content

Commit 436be4a

Browse files
aiskJelleZijlstraskirpichev
committed
Document how to use varargs in Argument Clinic
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
1 parent 053d92f commit 436be4a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

development-tools/clinic.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,27 @@ You can still use a self converter, a return converter, and specify
14951495
a *type* argument to the object converter for :c:macro:`METH_O`.
14961496

14971497

1498+
How to convert var-positional parameter functions
1499+
-------------------------------------------------
1500+
1501+
To convert a var-positional parameter function,
1502+
prepending the parameter name with ``*`` ,
1503+
and the parameter should use the ``object`` converter::
1504+
1505+
/*[clinic input]
1506+
var_positional_sample
1507+
1508+
foo: int
1509+
*args: object
1510+
[clinic start generated code]*/
1511+
1512+
The implementation function will receive var-positional arguments
1513+
as *args* array.
1514+
1515+
.. versionadded:: 3.11
1516+
.. versionchanged:: 3.14
1517+
1518+
14981519
How to convert ``tp_new`` and ``tp_init`` functions
14991520
---------------------------------------------------
15001521

0 commit comments

Comments
 (0)