diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst index 5fb8567ef8c95f..7d709820f65566 100644 --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -142,6 +142,16 @@ There are a few functions specific to Python functions. do not do type checking. Passing anything other than an instance of :c:data:`PyFunction_Type` is undefined behavior. +.. c:function:: PyObject *PyFunction_GET_BUILTINS(PyObject *op) + + Return the dictionary used to look up builtins (which might be ``NULL``) + when calling function *op*. + + This function cannot fail and does not do error checking; passing anything + other than an instance of :c:data:`PyFunction_Type` is undefined behavior. + There is no ``PyFunction_Get*`` equivalent for this function. + + .. versionadded 3.14 .. c:function:: int PyFunction_AddWatcher(PyFunction_WatchCallback callback) diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 144c5608e07426..5072db7da1c932 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -966,6 +966,9 @@ PyFunction_GetAnnotations:PyObject*:op:0: PyFunction_GET_ANNOTATIONS:PyObject*::0: PyFunction_GET_ANNOTATIONS:PyObject*:op:0: +PyFunction_GET_BUILTINS:PyObject*::0: +PyFunction_GET_BUILTINS:PyObject*:op:0: + PyFunction_GetClosure:PyObject*::0: PyFunction_GetClosure:PyObject*:op:0: