Skip to content

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

Open
encukou wants to merge 18 commits intopython:mainfrom
encukou:expressions-lists-sets-dicts
Open

gh-141984: Reword docs on "enclosed" atom grammar#148622
encukou wants to merge 18 commits intopython: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.

>>> [] # 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
[]
()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants