Pickling C objects

Stuart Reynolds S.I.Reynolds at cs.bham.ac.uk
Tue Jul 13 07:48:57 EDT 1999


I'm writing some new Python classes with a C implementation. How do you
make a C object pickleable?

Is it possible to use the __repr__ method? It would be easy for me to
output some Python code as a string which generated the object:

 'MyClass( MyComponent1(1,2,3), MyOtherComponent2('a','b','c') )'


Stuart




More information about the Python-list mailing list