summaryrefslogtreecommitdiffstats
path: root/Include
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 /Include
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 'Include')
-rw-r--r--Include/cpython/code.h6
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 */