@@ -33,24 +33,33 @@ bound into a function.
3333
3434 Return the number of free variables in *co *.
3535
36- .. c :function :: PyCodeObject* PyCode_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, int firstlineno, PyObject *lnotab )
36+ .. c :function :: PyCodeObject* PyCode_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, int firstlineno, PyObject *linetable, PyObject *exceptiontable )
3737
3838 Return a new code object. If you need a dummy code object to create a frame,
3939 use :c:func: `PyCode_NewEmpty ` instead. Calling :c:func: `PyCode_New ` directly
40- can bind you to a precise Python version since the definition of the bytecode
41- changes often.
40+ will bind you to a precise Python version since the definition of the bytecode
41+ changes often. The many arguments of this function are inter-dependent in complex
42+ ways, meaning that subtle changes to values are likely to result in incorrect
43+ execution or VM crashes. Use this function only with extreme care.
4244
43- .. c :function :: PyCodeObject* PyCode_NewWithPosOnlyArgs (int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab)
45+ .. versionchanged :: 3.11
46+ Added ``exceptiontable `` parameter.
47+
48+ .. c :function :: PyCodeObject* PyCode_NewWithPosOnlyArgs (int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
4449
4550 Similar to :c:func: `PyCode_New `, but with an extra "posonlyargcount" for positional-only arguments.
51+ The same caveats that apply to ``PyCode_New `` also apply to this function.
4652
4753 .. versionadded :: 3.8
4854
55+ .. versionchanged :: 3.11
56+ Added ``exceptiontable `` parameter.
57+
4958.. c :function :: PyCodeObject* PyCode_NewEmpty (const char *filename, const char *funcname, int firstlineno)
5059
5160 Return a new empty code object with the specified filename,
52- function name, and first line number. It is illegal to
53- :func: ` exec ` or :func: ` eval ` the resulting code object .
61+ function name, and first line number. The resulting code
62+ object will raise an `` Exception `` if executed .
5463
5564.. c :function :: int PyCode_Addr2Line (PyCodeObject *co, int byte_offset)
5665
0 commit comments