bsddb for k, v in db.items(): do order the numbers ?

Denis S. Otkidach ods at strana.ru
Wed Mar 2 11:31:04 CET 2005


On Mon, 28 Feb 2005 11:48:44 -0500
Christopher De Vries <devries at dyn.idolstarastronomer.com> wrote:

> If you want your key, value pairs in a certain order you have to sort
> them yourself. Dictionaries and bsddb keys are unsorted.

You are not right, records in BTree (btopen) are certainly sorted.  For
positive integers you can pack keys with struct.pack('>I', value).

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]



More information about the Python-list mailing list