Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[Bug #127377] bsddb set_location doc clarification

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


noreply at sourceforge

Jan 3, 2001, 12:52 AM

Post #1 of 3 (89 views)
Permalink
[Bug #127377] bsddb set_location doc clarification

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

Project: Python
Category: Documentation
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: nobody
Assigned to : nobody
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.


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


noreply at sourceforge

Jan 3, 2001, 5:02 AM

Post #2 of 3 (89 views)
Permalink
[Bug #127377] bsddb set_location doc clarification [In reply to]

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

Project: Python
Category: Documentation
Status: Open
Resolution: None
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.


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


noreply at sourceforge

Jan 4, 2001, 11:44 PM

Post #3 of 3 (88 views)
Permalink
[Bug #127377] bsddb set_location doc clarification [In reply to]

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

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.