summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-06-06 15:54:57 +0100
committerLars Wirzenius <liw@liw.fi>2011-06-06 15:54:57 +0100
commit6e2babb71965e4124a2d5211608f1c77cdaac416 (patch)
tree047e93bca29a310eedc831de8e8eeb2e82211fde /doc
parentff179b7b06bfa11750014fcbed2108f1614870ff (diff)
downloadlarch-6e2babb71965e4124a2d5211608f1c77cdaac416.tar.gz
Add some more examples.
Diffstat (limited to 'doc')
-rw-r--r--doc/index.rst18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/index.rst b/doc/index.rst
index e8799aa..d924ea4 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -62,11 +62,27 @@ To insert some data into the tree::
for key in ['abc', 'foo', bar']:
tree.insert(key, key.upper())
-To retrieve data::
+To look up value for one key::
+
+ print tree.lookup('foo')
+
+To look up a range::
for key, value in tree.lookup_range('aaa', 'zzz'):
print key, value
+To remove a key::
+
+ tree.remove('abc')
+
+To remove a range:
+
+ tree.remove_range('aaa', 'zzz')
+
+You probably don't need to worry about anything else than the
+``Forest`` and ``BTree`` classes, unless you want to provide your
+own ``NodeStore`` instance.
+
Reference manual
================