how to exclude specific things when pickling?

Christian Heimes lists at cheimes.de
Sun Sep 14 11:30:53 EDT 2008


Michael Palmer wrote:
> If your class defines a  __getstate__ method, it is expected to return
> the pickled state of the entire class. You can for example del those
> items from self.__dict__ that you don't want pickled and then return
> dumps(self).

FYI:
__getstate__ is ignored when __reduce__ is available.

Christian




More information about the Python-list mailing list