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

Jason McCampbell jmccampbell at enthought.com
Thu Nov 11 00:24:15 CET 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20101110/ef54e0dd/attachment.html>

More information about the Ironpython-users mailing list