This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josiahcarlson
Recipients ghaering, gregburd, gregory.p.smith, jcea, josiahcarlson, pitrou, rhettinger, skip.montanaro
Date 2008-09-12.01:33:38
SpamBayes Score 7.64944e-14
Marked as misclassified No
Message-id <1221183221.7.0.144438691928.issue3783@psf.upfronthosting.co.za>
In-reply-to
Content
> If you like, but "ordering semantics" is something which is just as
> easily done in Python, so I don't understand the point of integrating
> it in the dbm layer...

Actually, the db layer is *exactly* where it should be implemented, 
especially when an index can already exist (as is the case with the 
implementation I provided), especially when the total size of keys can 
easily overflow memory.  Implementing ordering semantics in Python would 
be a waste of what the db is good at: storing and ordering data.

> It sounds like an example of foolish consistency to me. The 
> performance characteristics are certainly too different to consider 
> dbm.anything a transparent replacement for standard dicts. And 
> dbm.sqlite only accepts strings, not the wide range of datatypes that 
> dicts accept as keys and values... so, given the big picture, I don't 
> see why you care about such a mostly pointless detail.

No one here has ever claimed that dbm should be a replacement for dicts, 
even if shelve attempts to do so.  This module should provide a shelve 
interface that mirrors bsddb's interface.  One of the things that was 
offered earlier was that since sqlite can store ints, floats, etc., as 
keys, maybe we should offer that ability.  I think that the base should 
act like a regular dbm object.  I think that a key-ordering should be 
available.  And if we are to offer arbitrary keys (ints, floats, unicode 
strings, byte strings, or None), it should be unordered like the base 
version.

I've uploaded a new copy of sq_dict that offers unordered shelve and 
arbitrary keys in a shelve db.
History
Date User Action Args
2008-09-12 01:33:41josiahcarlsonsetrecipients: + josiahcarlson, skip.montanaro, rhettinger, gregory.p.smith, jcea, ghaering, pitrou, gregburd
2008-09-12 01:33:41josiahcarlsonsetmessageid: <1221183221.7.0.144438691928.issue3783@psf.upfronthosting.co.za>
2008-09-12 01:33:40josiahcarlsonlinkissue3783 messages
2008-09-12 01:33:40josiahcarlsoncreate