pickling extension types

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top