PyCodeObject

Bytecode object

subclass of PyObject.

Members

Variables

co_argcount
int co_argcount;

#arguments, except *args

co_cellvars
PyObject* co_cellvars;

tuple of strings (cell variable names)

co_code
PyObject* co_code;

instruction opcodes

co_consts
PyObject* co_consts;

list (constants used)

co_filename
PyObject* co_filename;

string (where it was loaded from)

co_firstlineno
int co_firstlineno;

first source line number

co_flags
int co_flags;

CO_..., see below

co_freevars
PyObject* co_freevars;

tuple of strings (free variable names)

co_lnotab
PyObject* co_lnotab;

string (encoding addr<->lineno mapping) See Objects/lnotab_notes.txt for details.

co_name
PyObject* co_name;

string (name, for reference)

co_names
PyObject* co_names;

list of strings (names used)

co_nlocals
int co_nlocals;

#local variables

co_stacksize
int co_stacksize;

#entries needed for evaluation stack

co_varnames
PyObject* co_varnames;

tuple of strings (local variable names)

co_weakreflist
PyObject* co_weakreflist;

to support weakrefs to code objects */ /// Availability: >= 2.

co_zombieframe
void* co_zombieframe;

for optimization only (see frameobject.c) */ /// Availability: >= 2.

Meta