From 50631cf809830d4c398cee58159643913cd89411 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sat, 3 Sep 2011 19:16:07 -0700 Subject: update docs with namedtuple encoding to JSON object --- index.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'index.rst') diff --git a/index.rst b/index.rst index b478e5c..2d49ef9 100644 --- a/index.rst +++ b/index.rst @@ -399,7 +399,7 @@ Encoders and decoders +-------------------+---------------+ | Python | JSON | +===================+===============+ - | dict | object | + | dict, namedtuple | object | +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ @@ -414,6 +414,9 @@ Encoders and decoders | 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 -- cgit v1.2.1