Fix up README example
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Luke Murphy 2020-08-05 08:19:41 +02:00
parent c06fde788d
commit bf54dfa4cd
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -21,10 +21,19 @@ $ pip install flat-tree
## Example ## Example
```python ```python
from flat_tree.accessor import FlatTreeIterator from flat_tree import FlatTreeIterator
tree_iter = FlatTreeIterator() tree_iter = FlatTreeIterator()
assert tree_iter.index == 0
assert tree_iter.parent() == 1 print("tree index: ", tree_iter.index)
assert tree_iter.parent() == 3 print("tree first parent: ", tree_iter.parent())
print("tree next parent", tree_iter.parent())
```
Output:
```sh
tree index: 0
tree first parent: 1
tree next parent 3
``` ```