PyCodeObject

Bytecode object

subclass of PyObject.

Members

Mixins

__anonymous
mixin PyObject_HEAD
Undocumented in source.

Variables

co_argcount
int co_argcount;

#arguments, except *args

co_cell2arg
Py_ssize_t* co_cell2arg;
Undocumented in source.
co_cell2arg
ubyte* co_cell2arg;
Undocumented in source.
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_extra
void* co_extra;

Scratch space for extra data relating to the code object. Type is a void* to keep the format private in codeobject.c to force people to go through the proper APIs

co_filename
PyObject* co_filename;

string (where it was loaded from)

co_firstlineno
int co_firstlineno;

first source line number

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_kwonlyargcount
int co_kwonlyargcount;

#keyword only arguments

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.7

co_zombieframe
void* co_zombieframe;

for optimization only (see frameobject.c) Availability: >= 2.5

Mixed In Members

From mixin PyObject_HEAD

__anonymous
mixin _PyObject_HEAD_EXTRA
Undocumented in source.
ob_refcnt
Py_ssize_t ob_refcnt;

_

ob_type
PyTypeObject* ob_type;

_

Meta