Commit b5ebe5d
committed
docutils.nodes.Node.next_node can return
See code at https://github.com/docutils/docutils/blob/6d835be25d585e1dce688ef33c3876aa34ba59f0/docutils/docutils/nodes.py#L369:
```python
def next_node(self,
condition: type | Callable[[Node], bool] | None = None,
include_self: bool = False,
descend: bool = True,
siblings: bool = False,
ascend: bool = False,
) -> Node | None:
"""
Return the first node in the iterator returned by findall(),
or None if the iterable is empty.
Parameter list is the same as of `findall()`. Note that `include_self`
defaults to False, though.
"""
try:
return next(self.findall(condition, include_self,
descend, siblings, ascend))
except StopIteration:
return None
```None
1 parent 725a900 commit b5ebe5d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
0 commit comments