In [2]: import numpy as np
In [3]: u = np.arange (10)
In [5]: pickled = jsonpickle.encode (u)
In [6]: pickled
Out[6]: 'null'
> In [1]: import jsonpickle
>
> In [2]: import numpy as np
Numpy uses C extensions.
The best bet is to register a custom handler for u[0].__class__.
If you write one then it would be a good example to have in the source
tree, so do share.
There should be a testcase that demonstrates how to do this.
Have fun,
--
David
>
> In [3]: u = np.arange (10)
>
> In [5]: pickled = jsonpickle.encode (u)
>
> In [6]: pickled
> Out[6]: 'null'
>
> --
> You received this message because you are subscribed to the Google
> Groups "jsonpickle" group.
> To post to this group, send email to jsonp...@googlegroups.com.
> To unsubscribe from this group, send email to jsonpickle+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/jsonpickle?hl=en
> .
>
Oops, I originally said u[0].__class__.
It's u that's not encoding correctly, so the handler should be
registered for u.__class__ instead, namely
<type 'numpy.ndarray'>.
See ExternalHandlerTestCase and its use of UnicodeMixin and
UnicodeMixinHandler in jsonpickle_test.py for an example of
how to do this.
> In [5]: pickled = jsonpickle.encode (u)
>
> In [6]: pickled
> Out[6]: 'null'
>
> --
> You received this message because you are subscribed to the Google Groups "jsonpickle" group.
> To post to this group, send email to jsonp...@googlegroups.com.
> To unsubscribe from this group, send email to jsonpickle+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jsonpickle?hl=en.
>
--
David