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 /Objects | |
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 'Objects')
-rw-r--r-- | Objects/codeobject.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 7ebbfdb..aeb6a8c 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -1402,17 +1402,35 @@ _PyCode_GetVarnames(PyCodeObject *co) } PyObject * +PyCode_GetVarnames(PyCodeObject *code) +{ + return _PyCode_GetVarnames(code); +} + +PyObject * _PyCode_GetCellvars(PyCodeObject *co) { return get_localsplus_names(co, CO_FAST_CELL, co->co_ncellvars); } PyObject * +PyCode_GetCellvars(PyCodeObject *code) +{ + return _PyCode_GetCellvars(code); +} + +PyObject * _PyCode_GetFreevars(PyCodeObject *co) { return get_localsplus_names(co, CO_FAST_FREE, co->co_nfreevars); } +PyObject * +PyCode_GetFreevars(PyCodeObject *code) +{ + return _PyCode_GetFreevars(code); +} + static void deopt_code(_Py_CODEUNIT *instructions, Py_ssize_t len) { |