]> granicus.if.org Git - python/commitdiff
Fixed the documentation of parse_constant argument in json.load().
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 12 Nov 2016 20:47:16 +0000 (22:47 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 12 Nov 2016 20:47:16 +0000 (22:47 +0200)
parse_constant doesn't get called on 'null', 'true', 'false' since 3.1/2.7.

Doc/library/json.rst
Lib/json/__init__.py

index c1a52a79ea72c21127b9f4df06d6d65b70483bb4..858a59e3c5b2e4065253e826c5a91cabfc57f1ad 100644 (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
index f72b058123386b2f12effdfae7010abf516ca956..1118b0eb9903ba19cd681fc131feb6f0f94a99fa 100644 (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.