gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781)

This commit is contained in:
Bogdan Romanyuk 2024-03-19 12:20:38 +03:00 committed by GitHub
parent a3cf0fada0
commit a8e93d3dca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 23 additions and 6 deletions

View file

@ -34,10 +34,16 @@ bound into a function.
Return the number of free variables in a code object.
.. c:function:: int PyCode_GetFirstFree(PyCodeObject *co)
.. c:function:: int PyUnstable_Code_GetFirstFree(PyCodeObject *co)
Return the position of the first free variable in a code object.
.. versionchanged:: 3.13
Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`.
The old name is deprecated, but will remain available until the
signature changes again.
.. 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)
Return a new code object. If you need a dummy code object to create a frame,