Skip to content

gh-141984: Reword docs on "enclosed" atom grammar#148622

Merged
encukou merged 21 commits into
python:mainfrom
encukou:expressions-lists-sets-dicts
May 27, 2026
Merged

gh-141984: Reword docs on "enclosed" atom grammar#148622
encukou merged 21 commits into
python:mainfrom
encukou:expressions-lists-sets-dicts

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented Apr 15, 2026

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.


📚 Documentation preview 📚: https://cpython-previews--148622.org.readthedocs.build/

encukou and others added 14 commits January 21, 2026 18:04
Copy link
Copy Markdown
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@encukou This is a wonderful update. Thanks for taking the time to improve this page. 🎉 I only saw one small typo.

Comment thread Doc/reference/expressions.rst Outdated
>>> [] # empty list
[]
>>> () # empty tuple
[]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ()

Suggested change
[]
()

@hugovk hugovk removed their request for review April 25, 2026 19:01
@encukou
Copy link
Copy Markdown
Member Author

encukou commented May 13, 2026

Thank you for the review!

(I'm just getting back to docs after feature freeze...)

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 13, 2026

@encukou encukou merged commit 55f2518 into python:main May 27, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs May 27, 2026
@encukou encukou deleted the expressions-lists-sets-dicts branch May 27, 2026 12:32
@encukou encukou added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 28, 2026
@miss-islington-app
Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@miss-islington-app
Copy link
Copy Markdown

Sorry, @encukou, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 55f25183263b9a52fa246817344cdb32d6c3d722 3.15

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 28, 2026

GH-150552 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants