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/

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
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