diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2022-08-04 13:53:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 13:53:31 (GMT) |
commit | 42b102bbf9a9ae6fae8f6710202fb7afeeac277c (patch) | |
tree | 40cd485e5df107445183aa3a25b4998f1727cba3 /Include | |
parent | 0342c93a6b866118c894c4e1120fb4db316adebb (diff) | |
download | cpython-42b102bbf9a9ae6fae8f6710202fb7afeeac277c.zip cpython-42b102bbf9a9ae6fae8f6710202fb7afeeac277c.tar.gz cpython-42b102bbf9a9ae6fae8f6710202fb7afeeac277c.tar.bz2 |
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)
Diffstat (limited to 'Include')
-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 595cd9e..7ce6902 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 */ |