Skip to content

Commit 9f2a932

Browse files
Copilotmballance
andcommitted
Add clarifying comment to _safe_to_expr_model about stack behavior
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
1 parent 68ad84f commit 9f2a932

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vsc/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ def _safe_to_expr_model(value):
292292
in case the stack is empty or corrupted (which can happen during constraint
293293
solving failures).
294294
295+
Note: to_expr() either:
296+
- Creates a new expr object (which pushes to stack in __init__), OR
297+
- Returns an existing expr object that's already on the stack
298+
In both cases, we need to pop to maintain stack balance.
299+
295300
Args:
296301
value: The value to convert to an expression model
297302

0 commit comments

Comments
 (0)