Skip to content

Commit 686a96e

Browse files
committed
add doc example to has_equal_ast
1 parent e8e13eb commit 686a96e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pythonwhat/check_funcs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,20 @@ def has_equal_ast(incorrect_msg="FMT: Your code does not seem to match the solut
405405
code: optional code to use instead of the solution AST
406406
exact: whether the representations must match exactly. If false, the solution AST
407407
only needs to be contained within the student AST (similar to using test student typed).
408+
409+
:Example:
410+
411+
Student and Solution Code::
412+
413+
dict(a = 'value').keys()
414+
415+
SCT::
416+
417+
# all pass
418+
Ex().has_equal_ast()
419+
Ex().has_equal_ast(code = "dict(a = 'value').keys()")
420+
Ex().has_equal_ast(code = "dict(a = 'value')", exact = False)
421+
408422
"""
409423
rep = Reporter.active_reporter
410424

0 commit comments

Comments
 (0)