Message91339
Another reason this issue is really important, is that the lack of a
consistent iter() interface for dbm.* makes shelve iteration not
scalable; i.e. trying to iterate on a Shelf will run self.dict.keys() to
load the entire index into memory. This seems contrary to a primary
purpose of shelve, namely to store the index on-disk so as to avoid
having to keep the whole index in memory.
I suspect that for most users, shelve is the main way they will access
the dbm.* interfaces. Therefore, fixing the dbm.* interfaces so that
shelve is scalable seems like an important need.
Once dbm and gdbm support the iterator protocol, it will be trivial to
add an __iter__() method to shelve.Shelf, that simply returns
iter(self.dict). |
|
Date |
User |
Action |
Args |
2009-08-06 00:32:38 | foobaron | set | recipients:
+ foobaron, loewis, skip.montanaro, akitada |
2009-08-06 00:32:38 | foobaron | set | messageid: <1249518758.11.0.758069409132.issue5736@psf.upfronthosting.co.za> |
2009-08-06 00:32:36 | foobaron | link | issue5736 messages |
2009-08-06 00:32:35 | foobaron | create | |
|