Skip to content
Snippets Groups Projects
Commit 76fb7d24552c authored by Bob Ippolito's avatar Bob Ippolito
Browse files

update docs with namedtuple encoding to JSON object

parent 451987014e15
No related merge requests found
Version 2.1.7 released 2011-XX-XX
Version 2.2.0 released 2011-XX-XX
......@@ -2,4 +2,7 @@
* namedtuple (or other tuple subclasses with _asdict methods) are now
encoded as JSON objects rather than arrays.
https://github.com/simplejson/simplejson/pull/6
* JSONDecodeError is now raised instead of ValueError when a document
ends with an opening quote and the C speedups are in use.
https://github.com/simplejson/simplejson/issues/15
......
......@@ -399,7 +399,7 @@
+-------------------+---------------+
| Python | JSON |
+===================+===============+
| dict | object |
| dict, namedtuple | object |
+-------------------+---------------+
| list, tuple | array |
+-------------------+---------------+
......@@ -414,6 +414,9 @@
| None | null |
+-------------------+---------------+
.. versionchanged:: 2.2.0
Changed *namedtuple* encoding from JSON array to object.
To extend this to recognize other objects, subclass and implement a
:meth:`default` method with another method that returns a serializable object
for ``o`` if possible, otherwise it should call the superclass implementation
......
......@@ -80,7 +80,7 @@
+-------------------+---------------+
| Python | JSON |
+===================+===============+
| dict | object |
| dict, namedtuple | object |
+-------------------+---------------+
| list, tuple | array |
+-------------------+---------------+
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment