Skip to content Skip to sidebar Skip to footer

Python - Is It Possible To Extend The Set Of Things That Xml-rpc Can Serialize?

I have seen several questions asking how to send a numpy.ndarray through an xml-rpc call. This cannot be done out of the box because, as stated by the xml-rpc docs, there is a fixe

Solution 1:

I don't think there are any hooks for extension.

Rather than flatten/unflatten, you could encode/unencode the object -- for instance using pickle, or base64-encoded pickle.

If you do flatten keep in mind that you need:

<array>.shape
<array>.dtype
<array>.flat

Simple dtypes can be converted back and forth to strings; you may need to consider complex dtypes more carefully if you want to support them.

[EDIT] To answer your question succinctly: No -- no extension hooks are available.

Post a Comment for "Python - Is It Possible To Extend The Set Of Things That Xml-rpc Can Serialize?"