I would like to avoid pickling of certain fields in an instance of a class.
Currently, before pickling I just set those fields to None, but I wonder whether there’s more elegant solution?
I would like to avoid pickling of certain fields in an instance of a
Share
There is an example in the docs which solves your problem with
__getstate__and__setstate__.