FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-135676: Reword the Operators & Delimiters section(s) by encukou · Pull Request #137713 · python/cpython · GitHub

/ cpython Public

gh-135676: Reword the Operators & Delimiters section(s) - #137713

Merged
encukou merged 9 commits into
python:mainfrom
encukou:lex-analysis-operators
Sep 3, 2025
Merged

gh-135676: Reword the Operators & Delimiters section(s)#137713
encukou merged 9 commits into
python:mainfrom
encukou:lex-analysis-operators

Conversation

encukou commented Aug 13, 2025
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

Lexically, there is no difference between operators and delimiters, so I combined the section.

This section also serves as a kind of guide for what all the ASCII "symbol" characters do, with notes like “The period can also occur in floating-point and imaginary literals” and “The following printing ASCII characters are not used in Python”.
I've expanded the notes to include @, {, etc., but (for now) stopped short of adding a table of ASCII characters with links to where they appear.

The tables of symbols are reorganized slightly.
. was added to operators (like @, it can be either operator or delimiter).
-> was moved from augmented assignment to delimiters.


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

encukou and others added 4 commits August 13, 2025 16:38
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Comment thread Doc/reference/lexical_analysis.rst Outdated
Comment thread Doc/reference/lexical_analysis.rst Outdated
Comment thread Doc/reference/lexical_analysis.rst Outdated
Comment thread Doc/reference/lexical_analysis.rst Outdated
encukou marked this pull request as draft August 20, 2025 16:06

encukou commented Aug 20, 2025

Copy link
Copy Markdown
Member Author

So, I looked at this and #99000 again, and found a better (IMO) way to present the information. What do you think?

What this PR is missing now is information from some existing notes:

  • The period can also occur in floating-point and imaginary literals.
  • ' " # \ have special meaning [...]
  • $ ? ` are not used in Python

I'll try adding a section for that next week.

encukou marked this pull request as ready for review August 27, 2025 15:40
Comment thread Doc/reference/lexical_analysis.rst Outdated
Comment on lines +1374 to +1381
| arithmetic_operator
| bitwise_operator
| comparison_operator
| enclosing_delimiter
| other_delimiter
| assignment_operator
| other_op
| "..."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should e.g. assignment op be higher? += is a longer string than +.

Comment thread Doc/reference/lexical_analysis.rst Outdated
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
encukou enabled auto-merge (squash) September 3, 2025 15:19
encukou merged commit cfcfbdd into python:main Sep 3, 2025
27 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 3, 2025

Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 3, 2025
…GH-137713)

(cherry picked from commit cfcfbdd)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

bedevere-app Bot commented Sep 3, 2025

Copy link
Copy Markdown

GH-138457 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 3, 2025
encukou deleted the lex-analysis-operators branch September 5, 2025 15:25
lkollar pushed a commit to lkollar/cpython that referenced this pull request Sep 9, 2025
…GH-137713)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
hugovk pushed a commit that referenced this pull request Sep 11, 2025
…7713) (#138457)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

An operator is missing in the list of tokens

2 participants


Back | FazBrowse Home | New Git URL