Skip to content

Commit

Permalink
docs/library/ujson: Document dump() and load() functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgeorge committed Feb 15, 2018
1 parent d9bca1f commit e05fca4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/library/ujson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ data format.
Functions
---------

.. function:: dump(obj, stream)

Serialise *obj* to a JSON string, writing it to the given *stream*.

.. function:: dumps(obj)

Return *obj* represented as a JSON string.

.. function:: load(stream)

Parse the given *stream*, interpreting it as a JSON string and
deserialising the data to a Python object. The resulting object is
returned.

Parsing continues until end-of-file is encountered.
A :exc:`ValueError` is raised if the data in *stream* is not correctly formed.

.. function:: loads(str)

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

0 comments on commit e05fca4

Please sign in to comment.