shelve non-transparency

Michele Simionato michele.simionato at gmail.com
Wed Aug 24 03:07:33 EDT 2005


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




More information about the Python-list mailing list