@@ -128,8 +128,9 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
128128 instead of raising a ``TypeError``.
129129
130130 If ``ensure_ascii`` is false, then the strings written to ``fp`` can
131- contain non-ASCII characters if they appear in strings contained in
132- ``obj``. Otherwise, all such characters are escaped in JSON strings.
131+ contain non-ASCII and non-printable characters if they appear in strings
132+ contained in ``obj``. Otherwise, all such characters are escaped in JSON
133+ strings.
133134
134135 If ``check_circular`` is false, then the circular reference check
135136 for container types will be skipped and a circular reference will
@@ -145,10 +146,11 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
145146 level of 0 will only insert newlines. ``None`` is the most compact
146147 representation.
147148
148- If specified, ``separators`` should be an ``(item_separator, key_separator)``
149- tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and
150- ``(',', ': ')`` otherwise. To get the most compact JSON representation,
151- you should specify ``(',', ':')`` to eliminate whitespace.
149+ If specified, ``separators`` should be an ``(item_separator,
150+ key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is
151+ ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON
152+ representation, you should specify ``(',', ':')`` to eliminate
153+ whitespace.
152154
153155 ``default(obj)`` is a function that should return a serializable version
154156 of obj or raise TypeError. The default simply raises TypeError.
@@ -189,9 +191,10 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
189191 (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
190192 instead of raising a ``TypeError``.
191193
192- If ``ensure_ascii`` is false, then the return value can contain non-ASCII
193- characters if they appear in strings contained in ``obj``. Otherwise, all
194- such characters are escaped in JSON strings.
194+ If ``ensure_ascii`` is false, then the return value can contain
195+ non-ASCII and non-printable characters if they appear in strings
196+ contained in ``obj``. Otherwise, all such characters are escaped in
197+ JSON strings.
195198
196199 If ``check_circular`` is false, then the circular reference check
197200 for container types will be skipped and a circular reference will
@@ -207,10 +210,11 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
207210 level of 0 will only insert newlines. ``None`` is the most compact
208211 representation.
209212
210- If specified, ``separators`` should be an ``(item_separator, key_separator)``
211- tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and
212- ``(',', ': ')`` otherwise. To get the most compact JSON representation,
213- you should specify ``(',', ':')`` to eliminate whitespace.
213+ If specified, ``separators`` should be an ``(item_separator,
214+ key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is
215+ ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON
216+ representation, you should specify ``(',', ':')`` to eliminate
217+ whitespace.
214218
215219 ``default(obj)`` is a function that should return a serializable version
216220 of obj or raise TypeError. The default simply raises TypeError.
@@ -281,11 +285,12 @@ def load(fp, *, cls=None, object_hook=None, parse_float=None,
281285 ``object_hook`` will be used instead of the ``dict``. This feature
282286 can be used to implement custom decoders (e.g. JSON-RPC class hinting).
283287
284- ``object_pairs_hook`` is an optional function that will be called with the
285- result of any object literal decoded with an ordered list of pairs. The
286- return value of ``object_pairs_hook`` will be used instead of the ``dict``.
287- This feature can be used to implement custom decoders. If ``object_hook``
288- is also defined, the ``object_pairs_hook`` takes priority.
288+ ``object_pairs_hook`` is an optional function that will be called with
289+ the result of any object literal decoded with an ordered list of pairs.
290+ The return value of ``object_pairs_hook`` will be used instead of the
291+ ``dict``. This feature can be used to implement custom decoders. If
292+ ``object_hook`` is also defined, the ``object_pairs_hook`` takes
293+ priority.
289294
290295 To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
291296 kwarg; otherwise ``JSONDecoder`` is used.
@@ -306,11 +311,12 @@ def loads(s, *, cls=None, object_hook=None, parse_float=None,
306311 ``object_hook`` will be used instead of the ``dict``. This feature
307312 can be used to implement custom decoders (e.g. JSON-RPC class hinting).
308313
309- ``object_pairs_hook`` is an optional function that will be called with the
310- result of any object literal decoded with an ordered list of pairs. The
311- return value of ``object_pairs_hook`` will be used instead of the ``dict``.
312- This feature can be used to implement custom decoders. If ``object_hook``
313- is also defined, the ``object_pairs_hook`` takes priority.
314+ ``object_pairs_hook`` is an optional function that will be called with
315+ the result of any object literal decoded with an ordered list of pairs.
316+ The return value of ``object_pairs_hook`` will be used instead of the
317+ ``dict``. This feature can be used to implement custom decoders. If
318+ ``object_hook`` is also defined, the ``object_pairs_hook`` takes
319+ priority.
314320
315321 ``parse_float``, if specified, will be called with the string
316322 of every JSON float to be decoded. By default this is equivalent to
0 commit comments