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

Skip to content

Commit 58d3e54

Browse files
Fixed the documentation of parse_constant argument in json.load().
parse_constant doesn't get called on 'null', 'true', 'false' since 3.1/2.7.
2 parents babe4f8 + 022371f commit 58d3e54

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/json.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ Encoders and Decoders
339339
(e.g. :class:`float`).
340340

341341
*parse_constant*, if specified, will be called with one of the following
342-
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``, ``'null'``, ``'true'``,
343-
``'false'``. This can be used to raise an exception if invalid JSON numbers
342+
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``.
343+
This can be used to raise an exception if invalid JSON numbers
344344
are encountered.
345345

346346
If *strict* is false (``True`` is the default), then control characters

Lib/json/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None,
328328
for JSON integers (e.g. float).
329329
330330
``parse_constant``, if specified, will be called with one of the
331-
following strings: -Infinity, Infinity, NaN, null, true, false.
331+
following strings: -Infinity, Infinity, NaN.
332332
This can be used to raise an exception if invalid JSON numbers
333333
are encountered.
334334

0 commit comments

Comments
 (0)