I have an extension module for Python that uses SWIG as a wrapper and I try to serialize it with Pickle and I fail =)
I had to make a minor change to the accepted answer to make it work for my case. Since the initialization function of my class has some input arguments, I had to add an extra argument *arg
to the C.__init(self)
function, like so:
class PickalableC(C, PickalableSWIG):
def __init__(self, *args):
self.args = args
C.__init__(self, *args)
Maybe this is helpful for someone. I hope it is not too trivial.
I posted it as an answer since I cannot comment and learned it is not something you edit a post for.