Skip to content

docs: remove reference to get_nth_statement #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/content/docs/curriculum-help.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1117,19 +1117,6 @@ Node().is_empty() # True
Node("x = 1").find_variable("x").is_empty() # False
```

#### `get_nth_statement()`

```python
stmts = """
if True:
pass

x = 1
"""

Node(stmts).get_nth_statement(1).is_equivalent("x = 1") # True
```

#### `value_is_call()`

This allows you to check if the return value of a function call is assigned to a variable.
Expand Down Expand Up @@ -1184,6 +1171,19 @@ explorer.is_ordered("x=0", "x=1") # False
explorer.find_ifs()[0].is_ordered("print(x)", "print('x is:')") # False
```

#### How to get the nth statement

```python
stmts = """
if True:
pass

x = 1
"""

Node(stmts)[1].is_equivalent("x = 1") # True
```

## Notes on Python

- Python does **not** allow newline characters between keywords and their arguments. E.g:
Expand Down