Runtime Data Attributes

code.co_stacksize

Compiler-computed evaluation stack capacity. It is not call-stack depth or a portable estimate of runtime memory. Exact values depend on the interpreter and code generation.

Formal Syntax & Structure

python syntaxpython
code.co_stacksize

Return Value

int

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

Working Example

Example Snippetpython
def f(a,b): return a+bcode = f.__code__print(code.co_stacksize >= 1)
Python Reference