gh-146061: Clarify indent=None in json docs (GH-146095) · python/cpython@833dae7

GitHub

Original file line numberDiff line numberDiff line change@@ -211,7 +211,7 @@ Basic Usage

211211 a string (such as ``"\t"``) is used to indent each level.

212212 If zero, negative, or ``""`` (the empty string),

213213 only newlines are inserted.

214- If ``None`` (the default), the most compact representation is used.

214+ If ``None`` (the default), no newlines are inserted.

215215:type indent: int | str | None

216216217217:param separators:

Original file line numberDiff line numberDiff line change@@ -142,8 +142,8 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,

142142143143 If ``indent`` is a non-negative integer, then JSON array elements and

144144 object members will be pretty-printed with that indent level. An indent

145- level of 0 will only insert newlines. ``None`` is the most compact

146- representation.

145+ level of 0 will only insert newlines. ``None`` is the default and gives

146+a representation with no newlines inserted.

147147148148 If specified, ``separators`` should be an ``(item_separator,

149149 key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is

@@ -206,8 +206,8 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,

206206207207 If ``indent`` is a non-negative integer, then JSON array elements and

208208 object members will be pretty-printed with that indent level. An indent

209- level of 0 will only insert newlines. ``None`` is the most compact

210- representation.

209+ level of 0 will only insert newlines. ``None`` is the default and gives

210+a representation with no newlines inserted.

211211212212 If specified, ``separators`` should be an ``(item_separator,

213213 key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is