Skip to content

Commit e05fca4

Browse files
committed
docs/library/ujson: Document dump() and load() functions.
1 parent d9bca1f commit e05fca4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

docs/library/ujson.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,23 @@ data format.
1212
Functions
1313
---------
1414

15+
.. function:: dump(obj, stream)
16+
17+
Serialise *obj* to a JSON string, writing it to the given *stream*.
18+
1519
.. function:: dumps(obj)
1620

1721
Return *obj* represented as a JSON string.
1822

23+
.. function:: load(stream)
24+
25+
Parse the given *stream*, interpreting it as a JSON string and
26+
deserialising the data to a Python object. The resulting object is
27+
returned.
28+
29+
Parsing continues until end-of-file is encountered.
30+
A :exc:`ValueError` is raised if the data in *stream* is not correctly formed.
31+
1932
.. function:: loads(str)
2033

2134
Parse the JSON *str* and return an object. Raises :exc:`ValueError` if the

0 commit comments

Comments
 (0)