object returned by shelve.open is not an ordinary mapping : shelve « Database « Python Tutorial






import shelve
s = shelve.open('test.dat')
s['x'] = ['a', 'b', 'c']
s['x'].append('d')
print s['x']

temp = s['x']
temp.append('d')
s['x'] = temp
print s['x']








15.5.shelve
15.5.1.object returned by shelve.open is not an ordinary mapping
15.5.2.Storing Objects in a Shelve File
15.5.3.Changing Objects in a Shelve File
15.5.4.Writing to shelve file.
15.5.5.Reading a shelve file.
15.5.6.database based on shelve file