Josiah Carlson <[EMAIL PROTECTED]> added the comment: > 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. Added file: http://bugs.python.org/file11470/sq_dict.py _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3783> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com