Skip to content

Commit 4c66e66

Browse files
committed
Update v3/docs/opt-trace-format.md
1 parent 257c1d5 commit 4c66e66

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

‎v3/docs/opt-trace-format.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,24 @@ buffer up to that execution point, not only what's been printed by the most rece
564564

565565
## Function Stack Frames
566566

567-
(TODO: WRITE ME!)
567+
So far our example programs contained no function calls. Let's now kick it up a notch and see an example
568+
with function calls:
569+
570+
```python
571+
def foo(x, y, z):
572+
return bar(x, y)
573+
574+
def bar(a, b):
575+
return baz(a)
576+
577+
def baz(c):
578+
return c
579+
580+
result = foo(1, 2, 3)
581+
```
568582

583+
Let's jump straight to [Step 8 of 10](http://pythontutor.com/visualize.html#code=def+foo(x,+y,+z)%3A%0A++return+bar(x,+y)%0A++%0Adef+bar(a,+b)%3A%0A++return+baz(a)%0A++%0Adef+baz(c)%3A%0A++return+c%0A++%0Aresult+%3D+foo(1,+2,+3)%0A&mode=display&cumulative=false&py=2&curInstr=7)
584+
when the program is about to return from the call to `baz`.
569585

570586
## Closures and Zombie Frames (advanced)
571587

0 commit comments

Comments
 (0)