Iterators — Leo v4.8 documentation

### Navigation

- index
- next |
- previous |
- Leo v4.8 documentation »

# Iterators

Commanders and positions define `Python iterators`_ that return lists of positions in Leo outlines. These iterators are the easiest way of gaining access to the nodes of Leo outlines. Here are few examples (there are many more):

- c.all_positions() returns all the positions of the outline in order. Cloned nodes will appear several times in this list.
- c.all_unique_nodes() returns all the vnodes of the outline.
- p.self_and_subtree() returns p and all its descendant positions.
- p.children() returns all the positions of all p’s direct children.

### Navigation

- index
- next |
- previous |
- Leo v4.8 documentation »