Skip to content

Commit 3872350

Browse files
committed
improve PyFunction_New docs (closes python#26986)
Patch from Xiang Zhang.
1 parent 78b5ed9 commit 3872350

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/c-api/function.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ There are a few functions specific to Python functions.
3434
Return a new function object associated with the code object *code*. *globals*
3535
must be a dictionary with the global variables accessible to the function.
3636
37-
The function's docstring, name and *__module__* are retrieved from the code
38-
object, the argument defaults and closure are set to *NULL*.
37+
The function's docstring and name are retrieved from the code object. *__module__*
38+
is retrieved from *globals*. The argument defaults, annotations and closure are
39+
set to *NULL*. *__qualname__* is set to the same value as the function's name.
3940
4041
4142
.. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)

0 commit comments

Comments
 (0)