Skip to content

Commit 8d0ec39

Browse files
[3.12] gh-115653: Document PyCode_GetFirstFree() (GH-115654) (#115752)
gh-115653: Document PyCode_GetFirstFree() (GH-115654) Correct the return type of the PyCode_GetNumFree() documentation. (cherry picked from commit 10fc467) Co-authored-by: Bogdan Romanyuk <[email protected]>
1 parent f1c1afd commit 8d0ec39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/c-api/code.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ bound into a function.
3030
Return true if *co* is a :ref:`code object <code-objects>`.
3131
This function always succeeds.
3232
33-
.. c:function:: int PyCode_GetNumFree(PyCodeObject *co)
33+
.. c:function:: Py_ssize_t PyCode_GetNumFree(PyCodeObject *co)
3434
35-
Return the number of free variables in *co*.
35+
Return the number of free variables in a code object.
36+
37+
.. c:function:: int PyCode_GetFirstFree(PyCodeObject *co)
38+
39+
Return the position of the first free variable in a code object.
3640
3741
.. c:function:: PyCodeObject* PyUnstable_Code_New(int argcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, PyObject *qualname, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
3842

0 commit comments

Comments
 (0)