Re: shelve non-transparency

2005-08-24 Thread Michele Simionato
The option writeback=True seems to work: # put something in the shelve import shelve class C(object): pass s = shelve.open("x.shelve") s["x"] = C() s.close() # read it s = shelve.open("x.shelve", writeback=True) c = s["x"] c.attr = 1 print s["x"].attr # => 1 s.close() Michele

shelve non-transparency

2005-08-23 Thread Paul Rubin
class x: pass z = x() z.a = 'a' d = {'a': z} for i in range(5): print id(d['a']) prints the same id 5 times as you'd expect. d = shelve('filename') d['a'] = z for i in range(5): print id(d['a']) prints five different id's. So, for example, y = d['