I'd like to provide defaults for missing values using Python's pickle serialiser. Since the classes are simple, the defaults are naturally present in the classes's __init__
methods.
I can see from pickle documentation that there is __getnewargs__
. However, this only works for cases where __getnewargs__
was present prior to "pickling".
Is there any way to tell python pickle to call always the constructor rather than starting with an uninitialised object?