]> 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 6c84f94241a403566d85311df9ee512f0e7adcaa..546a09d69bde611adcf1a74e12ebb9ce6fc4f6ef 100644 (file)
@@ -156,6 +156,11 @@ Basic Usage
    :meth:`default` method to serialize additional types), specify it with the
    *cls* kwarg; otherwise :class:`JSONEncoder` is used.
 
+   .. 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:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]])