Skip to content

Commit 41c6628

Browse files
committed
Update opt-trace-format.md
1 parent 29ba787 commit 41c6628

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ The `event` field can either be:
755755

756756
As soon as a function becomes the parent of another function (i.e., a nested function is defined inside of it), then set the `is_parent` field of its stack entry to `true`. Also change its `unique_hash` by appending `_p` to it. The reason why we want to change `unique_hash` is that we want the frontend to *refresh* its display, and d3 might not refresh if it sees that the hash is identical to the prior frame. Conceptually, we want `unique_hash` to be different for a function before and after it turns into the parent of another function since we want to display it differently.
757757

758-
For example, when function `foo` is executing, its frame will have `is_parent` set to `false` when its first two lines execute. Then when its third line executes, that defines `bar` as a nested function within itself, so at that step, `foo` should have `is_parent = true` and `unique_hash = foo_f1_p` (or something similar).
758+
For example, when function `foo` is executing, its frame will have `is_parent=false` and `unique_hash = foo_f1` (or something similar) when its first two lines are running to define `x` and `y`, respectively. Then when its third line executes, that defines `bar` as a nested function within itself, so at that step, `foo` should have `is_parent=true` and `unique_hash = foo_f1_p` (or something similar).
759759

760760
```python
761761
def foo(y):

0 commit comments

Comments
 (0)