Message83516
shelf without writeback=True is too slow, while shelves with
writeback=True takes too much time to close. And even worse, these codes
can not run:
$ cat test_shelve.py
#!/usr/bin/env python
import shelve
store = shelve.open("/tmp/shelve.db", writeback=True)
class Test(object):
pass
def main():
store["a"] = Test()
if __name__ == '__main__':
main()
$ python test_shelve.py
Exception cPickle.PicklingError: "Can't pickle <class '__main__.Test'>:
it's not the same object as __main__.Test" in ignored
With this module, we can make it to run.
I think it's worth add this function to shelve. We can achieve great
improvement with some avoidable limitations.
The other approach to add this function is to add a extra option the
shelve.open(). We can discuss for which is better. |
|
Date |
User |
Action |
Args |
2009-03-13 13:12:06 | zhigang | set | recipients:
+ zhigang |
2009-03-13 13:12:05 | zhigang | set | messageid: <1236949925.76.0.785103969967.issue5483@psf.upfronthosting.co.za> |
2009-03-13 13:12:03 | zhigang | link | issue5483 messages |
2009-03-13 13:12:02 | zhigang | create | |
|