Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Linting fixes
  • Loading branch information
jsbueno committed Mar 27, 2026
commit 227b52d241e8faad103777748c54d64ad47b430c
15 changes: 8 additions & 7 deletions Lib/json/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def JSONArray(s_and_end, scan_once, array_hook, _w=WHITESPACE.match, _ws=WHITESP
raise JSONDecodeError("Illegal trailing comma before end of array", s, comma_idx)

if array_hook is not None:
return array_hook(values), end
values = array_hook(values)
return values, end


Expand Down Expand Up @@ -308,12 +308,13 @@ def __init__(self, *, object_hook=None, parse_float=None,
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 structute from any JSON data.
``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
structute from any JSON data.

``parse_float``, if specified, will be called with the string
of every JSON float to be decoded. By default this is equivalent to
Expand Down