summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-08-04 14:16:52 (GMT)
committerGitHub <noreply@github.com>2022-08-04 14:16:52 (GMT)
commitf2926358d1cd70625222eaf4b541584d2f2a1272 (patch)
tree37ed377090939bb2f3bee77b1bdf7ed925d0a82d /Include
parentc521c5cdc3f766ac5ac3574fa142aeec11c14267 (diff)
downloadcpython-f2926358d1cd70625222eaf4b541584d2f2a1272.zip
cpython-f2926358d1cd70625222eaf4b541584d2f2a1272.tar.gz
cpython-f2926358d1cd70625222eaf4b541584d2f2a1272.tar.bz2
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (GH-95008)
(cherry picked from commit 42b102bbf9a9ae6fae8f6710202fb7afeeac277c) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
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 ef8c642..7006060 100644
--- a/Include/cpython/code.h
+++ b/Include/cpython/code.h
@@ -209,6 +209,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 */