]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-141984: Reword docs on "enclosed" atom grammar (GH-148622) (GH-150552)
authorPetr Viktorin <encukou@gmail.com>
Fri, 29 May 2026 08:09:38 +0000 (10:09 +0200)
committerGitHub <noreply@github.com>
Fri, 29 May 2026 08:09:38 +0000 (10:09 +0200)
commitd842895a9d01dc34c448ca3e65d28aae469c8c23
tree15d949fc59ed5d25e31dd2d3fa1eabf90e374af3
parent21fa311c044704a1638b2ae0dc480fd9f7f68159
[3.15] gh-141984: Reword docs on "enclosed" atom grammar (GH-148622) (GH-150552)

Reorganize and reword the docs on atoms in parentheses, brackets and braces:
parenthesized groups, list/set/dict/tuple displays, and comprehensions.
(Generator expressions and yield atoms are left for later.)

In the spirit of better matching the underlying grammar, *comprehensions* are
covered separately from non-comprehension displays. Also, parenthesized forms
(with a single expression) and tuple displays are separated.
All sections are rewritten to start with simple cases and build up to the full
formal grammar.

(cherry picked from commit 55f25183263b9a52fa246817344cdb32d6c3d722)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/reference/expressions.rst
Doc/tools/removed-ids.txt