Even

    class A:
        pass

should do the trick. Only the instance attributes are saved by a
pickle,
not the methods or the class itself. The unpickler tries to merge the
saved data and the class/method info that is not saved to recreate
the fully functional instance... but of course this info should still
be available. The unpickler will even import the class from the
appropriate module if necessary.

If you want your unpickler to manufacture a class for you when
it is not available, you may use the gnosis xml pickler with the
appropriate security ("paranoia") level.

http://gnosis.cx/download/gnosis/xml/pickle/

Cheers,

Seb

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

Reply via email to