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

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

On Mon, 28 Feb 2005 11:48:44 -0500
Christopher De Vries <devries at> 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      [ru]

More information about the Python-list mailing list