]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: Document `PyFunction_SetKwDefaults` (GH-141294)
authorPeter Bierma <zintensitydev@gmail.com>
Sun, 9 Nov 2025 17:49:17 +0000 (12:49 -0500)
committerGitHub <noreply@github.com>
Sun, 9 Nov 2025 17:49:17 +0000 (12:49 -0500)
Doc/c-api/function.rst

index 0bac638957155e06630a767a83ece44450b70b41..609b5e885b6b16215d154c3b1c1fed403a1fc1c9 100644 (file)
@@ -102,6 +102,15 @@ There are a few functions specific to Python functions.
    dictionary of arguments or ``NULL``.
 
 
+.. c:function:: int PyFunction_SetKwDefaults(PyObject *op, PyObject *defaults)
+
+   Set the keyword-only argument default values of the function object *op*.
+   *defaults* must be a dictionary of keyword-only arguments or ``Py_None``.
+
+   This function returns ``0`` on success, and returns ``-1`` with an exception
+   set on failure.
+
+
 .. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
 
    Return the closure associated with the function object *op*. This can be ``NULL``