summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-21 10:31:56 (GMT)
committerGitHub <noreply@github.com>2024-02-21 10:31:56 (GMT)
commit8d0ec397324a6a5751c75430f0aa14db96461aeb (patch)
tree3f6f843765bf5b57e60354958cf5228d65fb73bc /Doc/c-api
parentf1c1afd45b283b5ede3b1da39fc916c9ba2a6095 (diff)
downloadcpython-8d0ec397324a6a5751c75430f0aa14db96461aeb.zip
cpython-8d0ec397324a6a5751c75430f0aa14db96461aeb.tar.gz
cpython-8d0ec397324a6a5751c75430f0aa14db96461aeb.tar.bz2
[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 10fc4675fdb14e19f2fdd15102c6533b9f71e992) Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/code.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/c-api/code.rst b/Doc/c-api/code.rst
index 382cfbf..f6fdd75 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 <code-objects>`.
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)