Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
a JSON document) to a Python object.
``object_hook`` is an optional function that will be called with the
result of any object literal decode (a ``dict``). The return value of
``object_hook`` will be used instead of the ``dict``. This feature
can be used to implement custom decoders (e.g. JSON-RPC class hinting).
``object_pairs_hook`` is an optional function that will be called with
the result of any object literal decoded with an ordered list of pairs.
The return value of ``object_pairs_hook`` will be used instead of the
``dict``. This feature can be used to implement custom decoders. If
``object_hook`` is also defined, the ``object_pairs_hook`` takes
priority.
``array_hook`` is an optional function that will be called with the
result of any literal array decode (a ``list``). The return value of
this function will be used instead of the ``list``. This feature can
be used along ``object_pairs_hook`` to customize the resulting data
structure - for example, by setting that to ``frozendict`` and
``array_hook`` to ``tuple``, one can get a deep immutable data structure
from any JSON data.
To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
kwarg; otherwise ``JSONDecoder`` is used.
3.1: Added the optional object_pairs_hook parameter. parse_constant doesn’t get called on ‘null’, ‘true’, ‘false’ anymore.
3.6: All optional parameters are now keyword-only. fp can now be a binary file. The input encoding should be UTF-8, UTF-16 or UTF-32.
3.11: The default parse_int of int() now limits the maximum length of the integer string via the interpreter’s integer string conversion length limitation to help avoid denial of service attacks.