[Python-checkins] cpython (3.5): Fixed the documentation of parse_constant argument in json.load().

serhiy.storchaka python-checkins at python.org
Sat Nov 12 15:49:06 EST 2016


https://hg.python.org/cpython/rev/61b419b77752
changeset:   105073:61b419b77752
branch:      3.5
parent:      105070:65b5518da6e2
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Nov 12 22:47:16 2016 +0200
summary:
  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.

files:
  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
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -332,8 +332,8 @@
    (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
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -297,7 +297,7 @@
     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.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list