diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-06-06 15:54:57 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-06-06 15:54:57 +0100 |
commit | 6e2babb71965e4124a2d5211608f1c77cdaac416 (patch) | |
tree | 047e93bca29a310eedc831de8e8eeb2e82211fde /doc | |
parent | ff179b7b06bfa11750014fcbed2108f1614870ff (diff) | |
download | larch-6e2babb71965e4124a2d5211608f1c77cdaac416.tar.gz |
Add some more examples.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/index.rst | 18 |
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 ================ |