bplustree lib

Cliff Wells LogiplexSoftware at earthlink.net
Tue Dec 10 20:04:08 EST 2002


On Tue, 2002-12-10 at 16:36, Pigio® wrote:
> There is someone that has used "bplustree"  llib?
> 
> THIS IS MY PROBLEM:
> 
> >>> file=open('test','w+b')
> >>> from bplustree import *
> >>> B = SBplusTree(file, 0, 200, 20)
> >>> B["this"] = 'pippo'
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "bplustree.py", line 1592, in __setitem__
>     self.tree[key] = seek
>   File "bplustree.py", line 1064, in __setitem__
>     if type(value)!=IntType: raise ValueError, "value must be int"
> 
> WHAT'S HAPPEN?

Haven't used this module before, but I got it to work by commenting out
line 1064 which tests to see if the value is an int.  I have no idea
what effect this will have elsewhere in the program.  The docs indicate
that strings are valid values so I'm not sure why that restriction was
put in the code (I'd contact the author).


Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bplustree import *
>>> f = open('test', "w+b")
>>> B = SBplusTree(f, 0, 212, 20)
>>> B.startup()
>>> B['eggs'] = 'spam'
>>> B['eggs']
'spam'
>>> B['bacon'] = 'lobster thermidor'
>>> B['bacon']
'lobster thermidor'


Regards,

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-list/attachments/20021210/b44d836f/attachment.sig>


More information about the Python-list mailing list