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.
This commit is contained in:
Serhiy Storchaka 2016-11-12 22:47:16 +02:00
parent 6b4b6e956e
commit 022371ff94
2 changed files with 3 additions and 3 deletions

View File

@ -332,8 +332,8 @@ Encoders and Decoders
(e.g. :class:`float`).
*parse_constant*, if specified, will be called with one of the following
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``, ``'null'``, ``'true'``,
``'false'``. This can be used to raise an exception if invalid JSON numbers
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``.
This can be used to raise an exception if invalid JSON numbers
are encountered.
If *strict* is false (``True`` is the default), then control characters

View File

@ -297,7 +297,7 @@ def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
for JSON integers (e.g. float).
``parse_constant``, if specified, will be called with one of the
following strings: -Infinity, Infinity, NaN, null, true, false.
following strings: -Infinity, Infinity, NaN.
This can be used to raise an exception if invalid JSON numbers
are encountered.