New submission from Zhigang Wang <w1z...@gmail.com>: 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. ---------- components: Library (Lib) files: fast_shelf.patch keywords: patch messages: 83516 nosy: zhigang severity: normal status: open title: [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True type: feature request versions: Python 3.1 Added file: http://bugs.python.org/file13317/fast_shelf.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5483> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com