How to pickle class derived from c++ extension
I understand that I can picke an extension class written in C/C++ by providing
a __reduce__() method along with __getstate__()/__setstate__(). While I still
havent gotten this to work, my main question is:
How could I possibly pickle an object of a python class which is derived from
the C++ extension?
It seems that I can define
>>> class Bar(list):
... pass
and add more attributes
>>> l=Bar()
>>> l.x=11
and __reduce__() will show the "x" attribute
>>> l.__reduce__()
(
On Fri, Sep 14, 2007, Martin Drautzburg wrote:
I understand that I can picke an extension class written in C/C++ by providing a __reduce__() method along with __getstate__()/__setstate__(). While I still havent gotten this to work, my main question is:
How could I possibly pickle an object of a python class which is derived from the C++ extension?
python-dev is not an appropriate place to ask questions about writing your own applications. I suggest the C++-sig or capi-sig lists or the comp.lang.python newsgroup. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ The best way to get information on Usenet is not to ask a question, but to post the wrong information.
participants (2)
-
Aahz
-
Martin Drautzburg