Browse Source

Fix up README example

master
Luke Murphy 1 year ago
parent
commit
bf54dfa4cd
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 17
      README.md

17
README.md

@ -21,10 +21,19 @@ $ pip install flat-tree
## Example
```python
from flat_tree.accessor import FlatTreeIterator
from flat_tree import FlatTreeIterator
tree_iter = FlatTreeIterator()
assert tree_iter.index == 0
assert tree_iter.parent() == 1
assert tree_iter.parent() == 3
print("tree index: ", tree_iter.index)
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
```

Loading…
Cancel
Save