Re: shelve in a ZipFile?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: shelve in a ZipFile?

From: Scott David Daniels <Scott.Daniels@Acm.Org>
Date: Fri Jul 01 2005 - 19:53:04 CEST

Terry Hancock wrote:
> I only just recently had a look at the shelve module....
> That would be handy if, for example, I wanted to couple
> (and compress into the bargain) by putting my two
> shelf files into a single zip archive.

You are, however, fooling yourself if you think a shelve
solution can be made to gracefully interact with a zip-
compressed version. In order to zip the shelve data, it
must all be seen in a pass, so every update would necessarily
rewrite the entire shelve storage. much better to extract the
entire shelve file, operate on it, and re-compress it.

Even if uncompressed, the zip archive format is not going to
happily allow you to change the size of any of the "files" it
stores.

--Scott David Daniels
Scott.Daniels@Acm.Org
Received on Thu Sep 29 16:41:48 2005