Skip to content

Commit 61976e3

Browse files
committed
add comment explaining non-argument placeholder check
1 parent ec63a22 commit 61976e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arraycontext/impl/pytato/outline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ def __call__(self, *args: object, **kwargs: object) -> ArrayOrContainer:
210210
arg_id_to_arg = _get_arg_id_to_arg(args, kwargs)
211211

212212
if __debug__:
213+
# Function arguments may produce corresponding placeholders that have
214+
# the same names as placeholders in the parent context. To avoid potential
215+
# ambiguity, forbid capturing non-argument placeholders in the function
216+
# body.
217+
213218
# Add a prefix to the names to distinguish them from any existing
214219
# placeholders
215220
arg_id_to_prefixed_placeholder = _get_arg_id_to_placeholder(

0 commit comments

Comments
 (0)