summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2022-08-04 13:53:31 (GMT)
committerGitHub <noreply@github.com>2022-08-04 13:53:31 (GMT)
commit42b102bbf9a9ae6fae8f6710202fb7afeeac277c (patch)
tree40cd485e5df107445183aa3a25b4998f1727cba3 /Objects
parent0342c93a6b866118c894c4e1120fb4db316adebb (diff)
downloadcpython-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.c18
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)
{