@@ -22,16 +22,21 @@ bound into a function.
2222.. c :var :: PyTypeObject PyCode_Type
2323
2424 This is an instance of :c:type: `PyTypeObject ` representing the Python
25- :class : `code ` type .
25+ :ref : `code object < code-objects >` .
2626
2727
2828.. c :function :: int PyCode_Check (PyObject *co)
2929
30- Return true if *co * is a :class: `code ` object. This function always succeeds.
30+ Return true if *co * is a :ref: `code object <code-objects >`.
31+ This function always succeeds.
3132
32- .. c :function :: int PyCode_GetNumFree (PyCodeObject *co)
33+ .. c :function :: Py_ssize_t PyCode_GetNumFree (PyCodeObject *co)
3334
34- 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.
3540
3641.. 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)
3742
@@ -48,7 +53,7 @@ bound into a function.
4853 .. versionchanged :: 3.11
4954 Added ``qualname `` and ``exceptiontable `` parameters.
5055
51- .. index :: single: PyCode_New
56+ .. index :: single: PyCode_New (C function)
5257
5358 .. versionchanged :: 3.12
5459
@@ -61,7 +66,7 @@ bound into a function.
6166 Similar to :c:func: `PyUnstable_Code_New `, but with an extra "posonlyargcount" for positional-only arguments.
6267 The same caveats that apply to ``PyUnstable_Code_New `` also apply to this function.
6368
64- .. index :: single: PyCode_NewWithPosOnlyArgs
69+ .. index :: single: PyCode_NewWithPosOnlyArgs (C function)
6570
6671 .. versionadded :: 3.8 as ``PyCode_NewWithPosOnlyArgs``
6772
@@ -220,7 +225,7 @@ may change without deprecation warnings.
220225 *free* will be called on non-``NULL`` data stored under the new index.
221226 Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
222227
223- .. index:: single: _PyEval_RequestCodeExtraIndex
228+ .. index:: single: _PyEval_RequestCodeExtraIndex (C function)
224229
225230 .. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
226231
@@ -238,7 +243,7 @@ may change without deprecation warnings.
238243 If no data was set under the index, set *extra * to ``NULL `` and return
239244 0 without setting an exception.
240245
241- .. index :: single: _PyCode_GetExtra
246+ .. index :: single: _PyCode_GetExtra (C function)
242247
243248 .. versionadded :: 3.6 as ``_PyCode_GetExtra``
244249
@@ -253,7 +258,7 @@ may change without deprecation warnings.
253258 Set the extra data stored under the given index to *extra *.
254259 Return 0 on success. Set an exception and return -1 on failure.
255260
256- .. index :: single: _PyCode_SetExtra
261+ .. index :: single: _PyCode_SetExtra (C function)
257262
258263 .. versionadded :: 3.6 as ``_PyCode_SetExtra``
259264
0 commit comments