]> granicus.if.org Git - python/commitdiff
#4783: document that is not possible to use json.dump twice on the same stream.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 15 Apr 2011 04:37:00 +0000 (07:37 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 15 Apr 2011 04:37:00 +0000 (07:37 +0300)
Doc/library/json.rst

index 2bf242fff42ba25ce99ba506bf7b17e920b495bc..0b42012c9acfd65ed8366f1369c3b36e350c3857 100644 (file)
@@ -156,6 +156,11 @@ Basic Usage
    Serialize *obj* to a JSON formatted :class:`str`.  The arguments have the
    same meaning as in :func:`dump`.
 
+   .. note::
+
+      Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol so
+      trying to serialize more objects with repeated calls to :func:`dump` and
+      the same *fp* will result in an invalid JSON file.
 
 .. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)