shelve file space always increase!

2008-09-17 Thread smalltalk
import shelve sf = shelve.open('e:/abc.db') for i in range(1): ... sf[str(i)]=i ... sf.close() sf = shelve.open('e:/abc.db') sf.clear() sf {} the abc.db is always 312k though i have use clear(), how can i shrink the space? -- http://mail.python.org/mailman/listinfo/python-list

Re: shelve file space always increase!

2008-09-17 Thread skip
smalltalk the abc.db is always 312k though i have use clear(), how can smalltalk i shrink the space? You really can't without deleting the file. Hash file implementations trade off file size against improve key lookup performance. Similar tradeoffs are made in the implementation of

Re: shelve file space always increase!

2008-09-17 Thread Michael Palmer
On Sep 17, 6:17 am, smalltalk [EMAIL PROTECTED] wrote: import shelve sf = shelve.open('e:/abc.db') for i in range(1): ... sf[str(i)]=i ... sf.close() sf = shelve.open('e:/abc.db') sf.clear() sf {} the abc.db is always 312k though i have use clear(), how can i shrink the