Yield all direct child nodes of *node*, that is, all fields that are nodes and all items of fields that are lists of nodes.
(node)
| 265 | |
| 266 | |
| 267 | def iter_child_nodes(node): |
| 268 | """ |
| 269 | Yield all direct child nodes of *node*, that is, all fields that are nodes |
| 270 | and all items of fields that are lists of nodes. |
| 271 | """ |
| 272 | for name, field in iter_fields(node): |
| 273 | if isinstance(field, AST): |
| 274 | yield field |
| 275 | elif isinstance(field, list): |
| 276 | for item in field: |
| 277 | if isinstance(item, AST): |
| 278 | yield item |
| 279 | |
| 280 | |
| 281 | def get_docstring(node, clean=True): |
no test coverage detected