From 50f5db21fb5cbf3cb2e17b083ff410aed38f0066 Mon Sep 17 00:00:00 2001 From: Hunter Hogan Date: Sun, 27 Apr 2025 09:25:00 -0500 Subject: [PATCH 1/3] Fix formatting in module docstring for `ast` https://github.com/python/cpython/issues/133046 --- Lib/ast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/ast.py b/Lib/ast.py index 507fec5f2d3890..9885f0ff67bb53 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1,6 +1,6 @@ """ ast - ~~~ + --- The `ast` module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with From c837c7089a03f5879f8d71fbdffda894b96c111e Mon Sep 17 00:00:00 2001 From: Hunter Hogan Date: Sun, 27 Apr 2025 11:30:28 -0500 Subject: [PATCH 2/3] #133046 ast docstring: remove header, dedent, 80-char width. --- Lib/ast.py | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/Lib/ast.py b/Lib/ast.py index 9885f0ff67bb53..818bb78156a821 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1,28 +1,25 @@ """ - ast - --- +The `ast` module helps Python applications to process trees of the Python +abstract syntax grammar. The abstract syntax itself might change with each +Python release; this module helps to find out programmatically what the current +grammar looks like and allows modifications of it. - The `ast` module helps Python applications to process trees of the Python - abstract syntax grammar. The abstract syntax itself might change with - each Python release; this module helps to find out programmatically what - the current grammar looks like and allows modifications of it. +An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as a +flag to the `compile()` builtin function or by using the `parse()` function +from this module. The result will be a tree of objects whose classes all +inherit from `ast.AST`. - An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as - a flag to the `compile()` builtin function or by using the `parse()` - function from this module. The result will be a tree of objects whose - classes all inherit from `ast.AST`. +A modified abstract syntax tree can be compiled into a Python code object using +the built-in `compile()` function. - A modified abstract syntax tree can be compiled into a Python code object - using the built-in `compile()` function. +Additionally various helper functions are provided that make working with the +trees simpler. The main intention of the helper functions and this module in +general is to provide an easy to use interface for libraries that work tightly +with the python syntax (template engines for example). - Additionally various helper functions are provided that make working with - the trees simpler. The main intention of the helper functions and this - module in general is to provide an easy to use interface for libraries - that work tightly with the python syntax (template engines for example). - - :copyright: Copyright 2008 by Armin Ronacher. - :license: Python License. +:copyright: Copyright 2008 by Armin Ronacher. +:license: Python License. """ from _ast import * From ea1ec1579a3ec757b82b3ad44d3b5e845b72dfec Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 27 Apr 2025 20:00:36 +0100 Subject: [PATCH 3/3] Keep existing wrapping --- Lib/ast.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Lib/ast.py b/Lib/ast.py index 818bb78156a821..aa788e6eb62c4f 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1,22 +1,21 @@ """ The `ast` module helps Python applications to process trees of the Python -abstract syntax grammar. The abstract syntax itself might change with each -Python release; this module helps to find out programmatically what the current -grammar looks like and allows modifications of it. - -An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as a -flag to the `compile()` builtin function or by using the `parse()` function -from this module. The result will be a tree of objects whose classes all -inherit from `ast.AST`. - -A modified abstract syntax tree can be compiled into a Python code object using -the built-in `compile()` function. - -Additionally various helper functions are provided that make working with the -trees simpler. The main intention of the helper functions and this module in -general is to provide an easy to use interface for libraries that work tightly -with the python syntax (template engines for example). - +abstract syntax grammar. The abstract syntax itself might change with +each Python release; this module helps to find out programmatically what +the current grammar looks like and allows modifications of it. + +An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as +a flag to the `compile()` builtin function or by using the `parse()` +function from this module. The result will be a tree of objects whose +classes all inherit from `ast.AST`. + +A modified abstract syntax tree can be compiled into a Python code object +using the built-in `compile()` function. + +Additionally various helper functions are provided that make working with +the trees simpler. The main intention of the helper functions and this +module in general is to provide an easy to use interface for libraries +that work tightly with the python syntax (template engines for example). :copyright: Copyright 2008 by Armin Ronacher. :license: Python License.