[Python-bugs-list] [Bug #127377] bsddb set_location doc clarification

noreply@sourceforge.net noreply@sourceforge.net
Thu, 04 Jan 2001 22:44:43 -0800


Bug #127377, was updated on 2001-Jan-02 23:52
Here is a current snapshot of the bug.

Project: Python
Category: Documentation
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Submitted by: nobody
Assigned to : fdrake
Summary: bsddb set_location doc clarification

Details: it seems that you can do

>>> import bsddb
>>> x = bsddb.btopen('/tmp/test.db', 'c')
>>> x['foo'] = '42'
>>> x['foa'] = '42'
>>> x['fox'] = '42'
>>> x.set_location('fob')
('foo', '42')

ie, set_location returns the *next* matching item
from the btree db if no exact match is found. i'm
assuming this is intended. this
is very useful behaviour, for example when you want to
look for keys with a certain prefix, but it is not
mentioned in the docs.


Follow-Ups:

Date: 2001-Jan-04 22:44
By: fdrake

Comment:
Updated explanation in Doc/lib/libbsddb.tex revision 1.6.

(Good catch, thanks!)
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=127377&group_id=5470