]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-148063: documentation: move ast.compare from "Compiler flags" to "ast helpers...
authorHunter Hogan <hunterhogan@users.noreply.github.com>
Sat, 2 May 2026 16:54:26 +0000 (11:54 -0500)
committerGitHub <noreply@github.com>
Sat, 2 May 2026 16:54:26 +0000 (19:54 +0300)
Doc/library/ast.rst

index 18df18d0c0542116d6d160be480cfbb0826a3186..49be47f15aa1a9c7a1b8972ee931c512afddbe91 100644 (file)
@@ -2545,6 +2545,20 @@ and classes for traversing abstract syntax trees:
       Added the *color* parameter.
 
 
+.. function:: compare(a, b, /, *, compare_attributes=False)
+
+   Recursively compares two ASTs.
+
+   *compare_attributes* affects whether AST attributes are considered
+   in the comparison. If *compare_attributes* is ``False`` (default), then
+   attributes are ignored. Otherwise they must all be equal. This
+   option is useful to check whether the ASTs are structurally equal but
+   differ in whitespace or similar details. Attributes include line numbers
+   and column offsets.
+
+   .. versionadded:: 3.14
+
+
 .. _ast-compiler-flags:
 
 Compiler flags
@@ -2580,20 +2594,6 @@ effects on the compilation of a program:
    .. versionadded:: 3.8
 
 
-.. function:: compare(a, b, /, *, compare_attributes=False)
-
-   Recursively compares two ASTs.
-
-   *compare_attributes* affects whether AST attributes are considered
-   in the comparison. If *compare_attributes* is ``False`` (default), then
-   attributes are ignored. Otherwise they must all be equal. This
-   option is useful to check whether the ASTs are structurally equal but
-   differ in whitespace or similar details. Attributes include line numbers
-   and column offsets.
-
-   .. versionadded:: 3.14
-
-
 .. _ast-cli:
 
 Command-line usage