Skip to content

Commit 8481c79

Browse files
committed
Argument Clinic: document vectorcall
Documents the directive added in python/cpython#145381 (gh-87613).
1 parent ef89264 commit 8481c79

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎development-tools/clinic/howto.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,19 @@ Just name them ``__new__`` or ``__init__`` as appropriate. Notes:
875875
(If your function doesn't support keywords, the parsing function
876876
generated will throw an exception if it receives any.)
877877

878+
* :ref:`vectorcall protocol <python:vectorcall>` support can be added using the
879+
``@vectorcall`` directive. This will output an additional function that can be
880+
used in the :c:member:`~PyTypeObject.tp_vectorcall` slot. Vectorcall adds
881+
moderate code, be sure to microbenchmark and validate it saves significant
882+
runtime.
883+
884+
Current restrictions:
885+
886+
* Optional groups are not supported.
887+
* The type must be immutable (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`).
888+
889+
.. versionadded:: 3.16
890+
878891

879892
How to change and redirect Clinic's output
880893
------------------------------------------

0 commit comments

Comments
 (0)