mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)
This commit is contained in:
parent
0342c93a6b
commit
42b102bbf9
6 changed files with 128 additions and 15 deletions
|
@ -210,6 +210,12 @@ PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index,
|
|||
/* Equivalent to getattr(code, 'co_code') in Python.
|
||||
Returns a strong reference to a bytes object. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_varnames') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_cellvars') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code);
|
||||
/* Equivalent to getattr(code, 'co_freevars') in Python. */
|
||||
PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code);
|
||||
|
||||
typedef enum _PyCodeLocationInfoKind {
|
||||
/* short forms are 0 to 9 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue