mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)
This commit is contained in:
parent
0342c93a6b
commit
42b102bbf9
6 changed files with 128 additions and 15 deletions
|
@ -1401,18 +1401,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