diff options
| author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2022-08-04 21:53:31 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-04 06:53:31 -0700 |
| commit | 42b102bbf9a9ae6fae8f6710202fb7afeeac277c (patch) | |
| tree | 40cd485e5df107445183aa3a25b4998f1727cba3 /Include/cpython/code.h | |
| parent | 0342c93a6b866118c894c4e1120fb4db316adebb (diff) | |
| download | cpython-git-42b102bbf9a9ae6fae8f6710202fb7afeeac277c.tar.gz | |
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)
Diffstat (limited to 'Include/cpython/code.h')
| -rw-r--r-- | Include/cpython/code.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 595cd9e94f..7ce6902255 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -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 */ |
