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 Simionato

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to