From 766ca5d07008c81df5fd87e0450a3d3cf46ed253 Mon Sep 17 00:00:00 2001 From: DarshCode123 Date: Wed, 21 Jan 2026 00:10:11 +0530 Subject: [PATCH] docs: clarify how to assert absence of function calls using Python AST helper --- src/content/docs/curriculum-help.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/content/docs/curriculum-help.mdx b/src/content/docs/curriculum-help.mdx index 983d69cc..40d06300 100644 --- a/src/content/docs/curriculum-help.mdx +++ b/src/content/docs/curriculum-help.mdx @@ -1531,6 +1531,17 @@ node.block_has_call("get") # True node.block_has_call("split") # False ``` +### Asserting absence of a function call + +Sometimes a challenge requires learners to remove a specific statement, such as a `print()` call. + +To assert that a function call does not exist in the learner’s code, simply negate the helper result: + +```python +assert not Node(code).has_call("print()") +assert not Node(code).block_has_call("print") +``` + #### `has_import()` ```python