@@ -155,7 +155,7 @@ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True,
155155
156156 To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
157157 ``.default()`` method to serialize additional types), specify it with
158- the ``cls`` kwarg.
158+ the ``cls`` kwarg; otherwise ``JSONEncoder`` is used .
159159
160160 """
161161 # cached encoder
@@ -213,7 +213,7 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
213213
214214 To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
215215 ``.default()`` method to serialize additional types), specify it with
216- the ``cls`` kwarg.
216+ the ``cls`` kwarg; otherwise ``JSONEncoder`` is used .
217217
218218 """
219219 # cached encoder
@@ -244,8 +244,16 @@ def load(fp, cls=None, object_hook=None, parse_float=None,
244244 ``object_hook`` will be used instead of the ``dict``. This feature
245245 can be used to implement custom decoders (e.g. JSON-RPC class hinting).
246246
247+ ``object_pairs_hook`` is an optional function that will be called with the
248+ result of any object literal decoded with an ordered list of pairs. The
249+ return value of ``object_pairs_hook`` will be used instead of the ``dict``.
250+ This feature can be used to implement custom decoders that rely on the
251+ order that the key and value pairs are decoded (for example,
252+ collections.OrderedDict will remember the order of insertion). If
253+ ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority.
254+
247255 To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
248- kwarg.
256+ kwarg; otherwise ``JSONDecoder`` is used .
249257
250258 """
251259 return loads (fp .read (),
@@ -264,6 +272,14 @@ def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
264272 ``object_hook`` will be used instead of the ``dict``. This feature
265273 can be used to implement custom decoders (e.g. JSON-RPC class hinting).
266274
275+ ``object_pairs_hook`` is an optional function that will be called with the
276+ result of any object literal decoded with an ordered list of pairs. The
277+ return value of ``object_pairs_hook`` will be used instead of the ``dict``.
278+ This feature can be used to implement custom decoders that rely on the
279+ order that the key and value pairs are decoded (for example,
280+ collections.OrderedDict will remember the order of insertion). If
281+ ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority.
282+
267283 ``parse_float``, if specified, will be called with the string
268284 of every JSON float to be decoded. By default this is equivalent to
269285 float(num_str). This can be used to use another datatype or parser
@@ -280,7 +296,7 @@ def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
280296 are encountered.
281297
282298 To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
283- kwarg.
299+ kwarg; otherwise ``JSONDecoder`` is used .
284300
285301 """
286302 if (cls is None and object_hook is None and
0 commit comments