mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-32360: Remove object_pairs_hook=OrderedDict examples (GH-5001)
This commit is contained in:
parent
badb894bbb
commit
629338f140
3 changed files with 11 additions and 25 deletions
|
|
@ -292,10 +292,8 @@ class JSONDecoder(object):
|
|||
``object_pairs_hook``, if specified will be called with the result of
|
||||
every JSON object 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 that rely on the
|
||||
order that the key and value pairs are decoded (for example,
|
||||
collections.OrderedDict will remember the order of insertion). If
|
||||
``object_hook`` is also defined, the ``object_pairs_hook`` takes
|
||||
This feature can be used to implement custom decoders.
|
||||
If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
|
||||
priority.
|
||||
|
||||
``parse_float``, if specified, will be called with the string
|
||||
|
|
@ -317,7 +315,6 @@ class JSONDecoder(object):
|
|||
characters will be allowed inside strings. Control characters in
|
||||
this context are those with character codes in the 0-31 range,
|
||||
including ``'\\t'`` (tab), ``'\\n'``, ``'\\r'`` and ``'\\0'``.
|
||||
|
||||
"""
|
||||
self.object_hook = object_hook
|
||||
self.parse_float = parse_float or float
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue