From: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:01:36 +0000 (+0300) Subject: gh-115653: Document PyCode_GetFirstFree() (#115654) X-Git-Tag: v3.13.0a5~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10fc4675fdb14e19f2fdd15102c6533b9f71e992;p=thirdparty%2FPython%2Fcpython.git gh-115653: Document PyCode_GetFirstFree() (#115654) Correct the return type of the PyCode_GetNumFree() documentation. --- diff --git a/Doc/c-api/code.rst b/Doc/c-api/code.rst index 382cfbff8640..f6fdd7574323 100644 --- a/Doc/c-api/code.rst +++ b/Doc/c-api/code.rst @@ -30,9 +30,13 @@ bound into a function. Return true if *co* is a :ref:`code object `. This function always succeeds. -.. c:function:: int PyCode_GetNumFree(PyCodeObject *co) +.. c:function:: Py_ssize_t PyCode_GetNumFree(PyCodeObject *co) - Return the number of free variables in *co*. + Return the number of free variables in a code object. + +.. c:function:: int PyCode_GetFirstFree(PyCodeObject *co) + + Return the position of the first free variable in a code object. .. 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)