I have SWIG(ed) a C library with lots of structs and wanted to use the shelve module to store some data on harddisk. Those data contains a simple C struct. I have read that I have to add the two functions __getstate__() and __setstate__() in addmethods for storing and retrieving. Is there someone who has done so to give me an example. Michael