Runtime Data Attributes

code.co_cellvars

Names of local bindings stored in cells for nested functions to access. Distinguish these from the nested code object's free variables.

Formal Syntax & Structure

python syntaxpython
code.co_cellvars

Return Value

tuple[str, ...]

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

Working Example

Example Snippetpython
def outer(x):    def f(): return x    return fcode = outer.__code__print(code.co_cellvars)
Python Reference