From 954dcfbc300f98f87674da3a6aed3a0088d674ee Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 30 May 2025 13:20:09 +0300 Subject: [PATCH 1/2] gh-134733: Fix documentation for the show_empty option of ast.dump() Optional None values are always omitted. --- Doc/library/ast.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index cf22250cac6091..f0540ed55253c4 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -2445,8 +2445,9 @@ and classes for traversing abstract syntax trees: indents that many spaces per level. If *indent* is a string (such as ``"\t"``), that string is used to indent each level. - If *show_empty* is ``False`` (the default), empty lists and fields that are ``None`` - will be omitted from the output. + Unless *show_empty* is true, optional empty lists will be + omitted from the output. + Optional ``None`` values are always omitted. .. versionchanged:: 3.9 Added the *indent* option. From 407c07e16035366b0d46b4c3e5542455a95f4087 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 30 May 2025 18:47:08 +0300 Subject: [PATCH 2/2] Update Doc/library/ast.rst Co-authored-by: Jelle Zijlstra --- Doc/library/ast.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index f0540ed55253c4..ca0654acb33689 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -2445,7 +2445,7 @@ and classes for traversing abstract syntax trees: indents that many spaces per level. If *indent* is a string (such as ``"\t"``), that string is used to indent each level. - Unless *show_empty* is true, optional empty lists will be + If *show_empty* is false (the default), optional empty lists will be omitted from the output. Optional ``None`` values are always omitted.