Message83516
| 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: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 |
|