From 58b6b985a0612e52da7a975c7791f89e98c8fd0b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 12 Nov 2016 22:47:16 +0200 Subject: [PATCH] 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. --- Doc/library/json.rst | 4 ++-- Lib/json/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 9e3e05e93b..70defa2407 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -344,8 +344,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 diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index a6ab7b2947..d1be041658 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -325,7 +325,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. -- 2.50.1