stack frame
The block of memory for one function call on the call stack, holding that call's local variables and return point.
In more detail
A frame is created when a function is called and discarded when it returns. Recursive functions create one frame per level, which is why their space cost equals their depth. A stack trace lists the frames that were active when an error happened, and a debugger lets you move up and down between them.
Related terms
- call stack — The region of memory where a running program keeps one frame for each function call that has started but not yet returned.
- recursion — A technique where a function solves a problem by calling itself on a smaller version of the same problem.
- traceback — The report Python prints when an unhandled exception stops a program, listing the chain of calls that led there and ending with the error.
Taught in
- Space, In-Place Work And The Call Stack — Algorithms & Data Structures for Working Engineers
- Animation: Loops, Bouncing, Flushing — Hands-on Python: Complete Video Course & Book
- Raising, And Writing Your Own Exception — Hands-on Python: Complete Video Course & Book
- Reading A Traceback Like A Professional — Hands-on Python: Complete Video Course & Book