[IronPython] Compatibility issue pickling .NET object stored in PythonTuple

Jason McCampbell jmccampbell at enthought.com
Wed Nov 10 15:24:15 PST 2010


Hi everyone,

We are working on porting the numpy package to IronPython and I am running
into an issue getting the output of cPickle to be compatible between CPython
and IronPython.  The issue appears to be that PythonTuple doesn't implement
__reduce__ and instead relies on .NET serialization.  Here is what I am
trying to do:

I have a .NET class dtype with a full Python interface, including
__reduce__.  Another class, ndarray, is being pickled and returns a
PythonTuple that includes an instance of dtype as one of it's elements.

What I was expecting to happen is that is dtype.__reduce__() is called when
it comes time to serialize it.  However, what I am seeing is either an
exception reporting dtype is not serializable is thrown or, if I mark it as
serializable, then the instance is serialized using the unity serializer and
the dtype.__reduce__ method is not called. For compatibility reasons I can't
use the .NET serialization.

Can anyone confirm if this is a known issue or if there is something that I
am missing?

Thanks,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20101110/ef54e0dd/attachment.htm>


More information about the Users mailing list