moved or renamedit might not be found in applications where pickled objects are shipped over network socketsit' possible to satisfy this constraint by shipping the text of the class along with stored instancesrecipients may simply store the class in local module file on the import search path prior to unpickling received instances where this is inconvenient or impossiblesimpler pickled objects such as lists and dictionaries with nesting may be transferred insteadas they require no source file to be reconstructed class changes must be backward compatible although python lets you change class while instances of it are stored on shelvethose changes must be backward compatible with the objects already stored for instanceyou cannot change the class to expect an attribute not associated with already stored persistent instances unless you first manually update those stored instances or provide extra conversion protocols on the class other pickle module constraints shelves also inherit the pickling systemsnonclass limitations as discussed earliersome types of objects ( open files and socketscannot be pickledand thus cannot be stored in shelve in an early python releasepersistent object classes also had to either use constructors with no arguments or provide defaults for all constructor arguments (much like the notion of +copy constructorthis constraint was dropped as of python -classes with nondefaulted constructor arguments now work as is in the pickling system other shelve limitations finallyalthough shelves store objects persistentlythey are not really object-oriented database systems such systems also implement features such as immediate automatic write-through on changestransaction commits and rollbackssafe concurrent updatesand object decomposition and delayed ("lazy"component fetches based on generated object ids parts of larger objects may be loaded into memory only as they are accessed it' possible to extend shelves to support such features manuallybut you don' need to--the zodb systemamong othersprovides an implementation of more complete object-oriented database system it is constructed on top of python' built-in pickling interestinglypython avoids calling the class to re-create pickled instance and instead simply makes class object genericallyinserts instance attributesand sets the instance' __class__ pointer to the original class directly this avoids the need for defaultsbut it also means that the class __init__ constructors that are no longer called as objects are unpickledunless you provide extra methods to force the call see the library manual for more detailsand see the pickle module' source code (pickle py in the source libraryif you're curious about how this works or see the pyform example later in this -it does something very similar with __class__ links to build an instance object from class and dictionary of attributeswithout calling the class' __init__ constructor this makes constructor argument defaults unnecessary in classes used for records browsed by pyformbut it' the same idea databases and persistence