Runtime Data Attributes

code.co_code

Bytecode representation exposed by the code object. Not a stable cross-version format or necessarily the specialized instructions currently executed; use dis for inspection.

Formal Syntax & Structure

python syntaxpython
code.co_code

Return Value

bytes

Value exposed by this attribute; availability and mutability depend on the owner as described.

Working Example

Example Snippetpython
def f(x): return x+1code = f.__code__print((isinstance(code.co_code,bytes),len(code.co_code)>0))
Python Reference