]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-146061: Clarify indent=None in json docs (GH-146095) (GH-149668)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 May 2026 11:40:39 +0000 (13:40 +0200)
committerGitHub <noreply@github.com>
Mon, 11 May 2026 11:40:39 +0000 (11:40 +0000)
(cherry picked from commit 833dae7c1fdc556200cbfc3e76bad4d54628042c)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Doc/library/json.rst
Lib/json/__init__.py

index 57aad5ba9d17933e4e69a77ce7691b0486adb09b..231654a3a9315f3f174753931a3e340e75dc010c 100644 (file)
@@ -214,7 +214,7 @@ Basic Usage
       a string (such as ``"\t"``) is used to indent each level.
       If zero, negative, or ``""`` (the empty string),
       only newlines are inserted.
-      If ``None`` (the default), the most compact representation is used.
+      If ``None`` (the default), no newlines are inserted.
    :type indent: int | str | None
 
    :param separators:
index 9eaa4f3fbc16793adc061f9f5ee9dd0aab159b20..800cc37f6afe31d86345d7b4d0ce9cf08efe8082 100644 (file)
@@ -143,8 +143,8 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
 
     If ``indent`` is a non-negative integer, then JSON array elements and
     object members will be pretty-printed with that indent level. An indent
-    level of 0 will only insert newlines. ``None`` is the most compact
-    representation.
+    level of 0 will only insert newlines. ``None`` is the default and gives
+    a representation with no newlines inserted.
 
     If specified, ``separators`` should be an ``(item_separator,
     key_separator)`` tuple.  The default is ``(', ', ': ')`` if *indent* is
@@ -207,8 +207,8 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
 
     If ``indent`` is a non-negative integer, then JSON array elements and
     object members will be pretty-printed with that indent level. An indent
-    level of 0 will only insert newlines. ``None`` is the most compact
-    representation.
+    level of 0 will only insert newlines. ``None`` is the default and gives
+    a representation with no newlines inserted.
 
     If specified, ``separators`` should be an ``(item_separator,
     key_separator)`` tuple.  The default is ``(', ', ': ')`` if *indent* is