From 255fde879dcd2dd67a15400d1c9b118898d25624 Mon Sep 17 00:00:00 2001 From: Hunter Hogan Date: Tue, 31 Mar 2026 20:24:56 -0500 Subject: [PATCH] documentation: move from "Compiler flags" to "ast helpers". 3.14 needs update, too. --- Doc/library/ast.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 9b4e7ae18348f1..9f2df27c003c24 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -2528,6 +2528,20 @@ and classes for traversing abstract syntax trees: Omit optional ``Load()`` values by default. +.. 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 @@ -2563,20 +2577,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