https://github.com/python/cpython/commit/4ce6d8245329863922cfb300731f8361aa9f5b55 commit: 4ce6d8245329863922cfb300731f8361aa9f5b55 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-05-03T16:02:25Z summary:
[3.14] gh-148063: documentation: move ast.compare from "Compiler flags" to "ast helpers" (GH-147954) (#149291) (cherry picked from commit 7b0244dbc7a5ba037e2cf2b5c8db1e35a0643a18) Co-authored-by: Hunter Hogan <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/library/ast.rst diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 31c406c62b171f..583b55cc8c14b8 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -2549,6 +2549,20 @@ and classes for traversing abstract syntax trees: type_ignores=[]) +.. 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 @@ -2584,20 +2598,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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
