Runtime Data Attributes
code.co_varnames
Compiled local variable names with parameter names first; does not describe all globals, builtins or closure bindings.
Formal Syntax & Structure
python syntaxpython
code.co_varnamesReturn Value
tuple[str, ...]
Value exposed by this attribute; availability and mutability depend on the owner as described.
Working Example
Example Snippetpython
def f(a,b): total = a+b return totalcode = f.__code__print(code.co_varnames)