B
benevilent
Hey,
I am creating an extension type in C for Python, which I want it such
that instances can be pickled. I basically want the functionality of the
'object' type such that subclasses of the type which I define, can
define methods including __getstate__ which will get called on
pickling/unpickling.
To do this I need to define the __reduce__ method. The __reduce__ method
in typeobject.c is exactly what I need for this task. Is there a way to
reuse this without copy-pasting the code?
Thanks,
Laurie
I am creating an extension type in C for Python, which I want it such
that instances can be pickled. I basically want the functionality of the
'object' type such that subclasses of the type which I define, can
define methods including __getstate__ which will get called on
pickling/unpickling.
To do this I need to define the __reduce__ method. The __reduce__ method
in typeobject.c is exactly what I need for this task. Is there a way to
reuse this without copy-pasting the code?
Thanks,
Laurie