`JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
+.. note::
+ The term "object" in the context of JSON processing in Python can be
+ ambiguous. All values in Python are objects. In JSON, an object refers to
+ any data wrapped in curly braces, similar to a Python dictionary.
+
.. warning::
Be cautious when parsing JSON data from untrusted sources. A malicious
JSON string may cause the decoder to consume considerable CPU and memory
resources. Limiting the size of data to be parsed is recommended.
-:mod:`json` exposes an API familiar to users of the standard library
+This module exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules.
Encoding basic Python object hierarchies::
"6": 7
}
-Specializing JSON object encoding::
+Customizing JSON object encoding::
>>> import json
>>> def custom_json(obj):
>>> json.load(io)
['streaming API']
-Specializing JSON object decoding::
+Customizing JSON object decoding::
>>> import json
>>> def as_complex(dct):
:param object_hook:
If set, a function that is called with the result of
- any object literal decoded (a :class:`dict`).
+ any JSON object literal decoded (a :class:`dict`).
The return value of this function will be used
instead of the :class:`dict`.
This feature can be used to implement custom decoders,
:param object_pairs_hook:
If set, a function that is called with the result of
- any object literal decoded with an ordered list of pairs.
+ any JSON object literal decoded with an ordered list of pairs.
The return value of this function will be used
instead of the :class:`dict`.
This feature can be used to implement custom decoders.