survey: is shelve broken? should it be fixed?

Roman Suzi rnd at onego.ru
Tue May 7 05:03:51 EDT 2002


On Tue, 7 May 2002, Alex Martelli wrote:

> We probably can't change this default (mis-)behavior due to backward
> compatibility needs, but it wouldn't be too hard to at least give a simple 
> _optional_ way out, even though off-by-default:
> 
> >>> s.close()
> >>> s=shelve.open('ciao','c',smart=1)
> >>> s['ciao']
> [0, 1, 2, 3]
> >>> s['ciao'].append(23)
> >>> s['ciao']
> [0, 1, 2, 3, 23]
> >>> s.close()
> >>> s=shelve.open('ciao','c')
> >>> s['ciao']
> [0, 1, 2, 3, 23]
> >>>

I think it is better to fix and not looking for backward compatibility!
It will not be seen on the background of other major changes to Python.
So, no smart is needed, IMHO.

Or, maybe python needs some runtime key or phrase like:

from __past__ import broken_shelve

Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
 






More information about the Python-list mailing list