[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-26 Thread Ethan Furman
Ethan Furman added the comment: For the curious, here are all the tracebacks: -- json.dumps(a) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.3/json/__init__.py, line 236, in dumps return _default_encoder.encode(obj) File

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-25 Thread miscjunk
miscjunk added the comment: numpy.ndarray is also not serializable by json.dumps() import numpy as np import json a = np.array([1,2,3,4]) json.dumps(a) #crash json.dumps(a[0]) #this works! -- title: json.dumps() claims numpy.bool_ is not serializable - json.dumps() claims

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-25 Thread R. David Murray
R. David Murray added the comment: I would (naively) not expect either of these to be serializable. They are not base data types, which is all the json module handles unless you add extra handlers yourself. 'crash' means interpreter crash (segfault), by the way. -- nosy:

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-25 Thread miscjunk
miscjunk added the comment: Thanks for the explanation. I suppose this should be posted to the numpy tracker then? Would it be possible for numpy to 'just work' with the json module? Or will the final resolution be to use a handler (the default= parameter in json.loads) ? Thanks --

[issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable

2013-06-25 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18303 ___ ___ Python-bugs-list