mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (GH-95008)
(cherry picked from commit 42b102bbf9
)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
This commit is contained in:
parent
c521c5cdc3
commit
f2926358d1
6 changed files with 128 additions and 15 deletions
|
@ -1399,18 +1399,36 @@ _PyCode_GetVarnames(PyCodeObject *co)
|
|||
return get_localsplus_names(co, CO_FAST_LOCAL, co->co_nlocals);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue