From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 9 Nov 2025 17:55:09 +0000 (+0100) Subject: [3.14] gh-141004: Document `PyFunction_SetKwDefaults` (GH-141294) (GH-141304) X-Git-Tag: v3.14.1~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86824651bce4526ea491ca7b1614f5f52e67bcd9;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-141004: Document `PyFunction_SetKwDefaults` (GH-141294) (GH-141304) gh-141004: Document `PyFunction_SetKwDefaults` (GH-141294) (cherry picked from commit 18529b580b59b8d075641da6c685bef377eb0a7b) Co-authored-by: Peter Bierma --- diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst index 5fb8567ef8c9..7908e4f8561a 100644 --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -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``