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 u
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 Py
>>> 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/listin