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 zhigang
Recipients zhigang
Date 2009-03-13.13:12:02
SpamBayes Score 2.3822324e-09
Marked as misclassified No
Message-id <1236949925.76.0.785103969967.issue5483@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-03-13 13:12:06zhigangsetrecipients: + zhigang
2009-03-13 13:12:05zhigangsetmessageid: <1236949925.76.0.785103969967.issue5483@psf.upfronthosting.co.za>
2009-03-13 13:12:03zhiganglinkissue5483 messages
2009-03-13 13:12:02zhigangcreate