[Tutor] btree problems

Hans Nowak hnowak@cuci.nl
Mon, 13 Mar 2000 23:29:38 +0100


Bruce Sass writes:

> This is what it generates:
> ----- tree-test2.output.txt -----
> Created a tree: tree = <__main__.btree instance at 83d7ce8>
> Created a node: n = <__main__.node instance at 83b3d58>
>   n.entry = <__main__.datapkg instance at 83dda48>
>   n.entry.key = first
>   n.entry.data = ['some', 'data']
> Inserted the node into the tree:
>   tree = <__main__.btree instance at 83d7ce8>
>   tree.entry =
> Traceback (innermost last):
>   File "/home/bsass/usr/src/python/tree-test2.py", line 43, in ?
>     print "  tree.entry =", tree.entry
> AttributeError: entry
> ----- end trees-test2.output.txt -----
> 
> What am I doing wrong?

Well, at a quick glance... The tree object does not have an attribute 
'entry'. The node does, but not the tree, so tree.entry obviously will not 
work. Maybe tree.tree.entry will (I did not verify this though).

HTH,

--Hans Nowak (zephyrfalcon@hvision.nl)
Homepage: http://www.hvision.nl/~ivnowa/newsite/
Python questions? See http://tor.dhs.org/~zephyrfalcon/snippets
You call me a masterless man. You are wrong. I am my own master.