changes to shelf items fail silently?

eichin at eichin at
Mon Mar 17 22:42:29 CET 2003

import shelve

complex_example ="/tmp/complex_example_shelf")
complex_example["a"] = []
print complex_example["a"]
print complex_example["a"]
print complex_example["a"]
complex_example["a"] = complex_example["a"] + ["b"]
print complex_example["a"]

$ python 

So, I see why the last case works (it can't help *but* work) but I
don't get why the append/extend mutators don't.  Or rather, why if
they can't work, I don't get an error thrown so I notice it...

(this occurs in 2.1 and 2.2.  Is there a "better" shelf-like thing
that I should use instead, for more completely persistent data?)

More information about the Python-list mailing list