2828Compact encoding::
2929
3030 >>> import json
31- >>> from collections import OrderedDict
32- >>> mydict = OrderedDict([('4', 5), ('6', 7)])
31+ >>> mydict = {'4': 5, '6': 7}
3332 >>> json.dumps([1,2,3,mydict], separators=(',', ':'))
3433 '[1,2,3,{"4":5,"6":7}]'
3534
@@ -285,14 +284,11 @@ def load(fp, *, cls=None, object_hook=None, parse_float=None,
285284 ``object_pairs_hook`` is an optional function that will be called with the
286285 result of any object literal decoded with an ordered list of pairs. The
287286 return value of ``object_pairs_hook`` will be used instead of the ``dict``.
288- This feature can be used to implement custom decoders that rely on the
289- order that the key and value pairs are decoded (for example,
290- collections.OrderedDict will remember the order of insertion). If
291- ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority.
287+ This feature can be used to implement custom decoders. If ``object_hook``
288+ is also defined, the ``object_pairs_hook`` takes priority.
292289
293290 To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
294291 kwarg; otherwise ``JSONDecoder`` is used.
295-
296292 """
297293 return loads (fp .read (),
298294 cls = cls , object_hook = object_hook ,
@@ -313,10 +309,8 @@ def loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None,
313309 ``object_pairs_hook`` is an optional function that will be called with the
314310 result of any object literal decoded with an ordered list of pairs. The
315311 return value of ``object_pairs_hook`` will be used instead of the ``dict``.
316- This feature can be used to implement custom decoders that rely on the
317- order that the key and value pairs are decoded (for example,
318- collections.OrderedDict will remember the order of insertion). If
319- ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority.
312+ This feature can be used to implement custom decoders. If ``object_hook``
313+ is also defined, the ``object_pairs_hook`` takes priority.
320314
321315 ``parse_float``, if specified, will be called with the string
322316 of every JSON float to be decoded. By default this is equivalent to
@@ -337,7 +331,6 @@ def loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None,
337331 kwarg; otherwise ``JSONDecoder`` is used.
338332
339333 The ``encoding`` argument is ignored and deprecated.
340-
341334 """
342335 if isinstance (s , str ):
343336 if s .startswith ('\ufeff ' ):
0 commit comments