GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-135676: Reword the Operators & Delimiters section(s) by encukou · Pull Request #137713 · python/cpython

Conversation

@encukou

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

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: Reword the Lexical Analysis chapter of the docs #135676

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
encukou and others added 4 commits August 13, 2025 16:38
@encukou @blaisep @AA-Turner
Initial rewording; add table of ASCII source characters
01bed13
Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@encukou
Remove the Summary of source characters
5efbd33
@encukou
More rewording
df5a1d2
@encukou
Add notes about where else symbols appear
9a23017
@encukou
encukou requested review from AA-Turner and willingc as code owners August 13, 2025 15:11
@bedevere-app bedevere-app Bot added awaiting core review docs Documentation in the Doc dir skip news labels Aug 13, 2025
@github-project-automation github-project-automation Bot added this to Docs PRs Aug 13, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Aug 13, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Aug 13, 2025
Reword the Lexical Analysis chapter of the docs #135676
Open
@encukou encukou added the needs backport to 3.14 bugs and security fixes label Aug 13, 2025
AA-Turner
AA-Turner reviewed Aug 13, 2025
View reviewed changes
Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland mentioned this pull request Aug 17, 2025
An operator is missing in the list of tokens #99000
Closed
@StanFromIreland StanFromIreland linked an issue Aug 17, 2025 that may be closed by this pull request
An operator is missing in the list of tokens #99000
Closed
@encukou
Reword the OP section once again
58a414f
@encukou
encukou marked this pull request as draft August 20, 2025 16:06
@bedevere-app bedevere-app Bot removed the awaiting core review label Aug 20, 2025
@encukou

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou added 2 commits August 27, 2025 16:16
@encukou
Move the reference to alternative list up
15bf260
@encukou
Add forgotten operator
9de8961
@encukou
encukou marked this pull request as ready for review August 27, 2025 15:40
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 27, 2025
AA-Turner
AA-Turner approved these changes Sep 3, 2025
View reviewed changes
Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Sep 3, 2025
AA-Turner
AA-Turner reviewed Sep 3, 2025
View reviewed changes
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
| "..."

@AA-Turner AA-Turner Sep 3, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
AA-Turner
AA-Turner reviewed Sep 3, 2025
View reviewed changes
Comment thread Doc/reference/lexical_analysis.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@encukou @AA-Turner
Update Doc/reference/lexical_analysis.rst
59019bb
Co-authored-by: Adam Turner <[email protected]>
@encukou
Reorder the tokens to put longer ones first
d0911f3
@encukou
encukou enabled auto-merge (squash) September 3, 2025 15:19
@encukou
encukou merged commit cfcfbdd into python:main Sep 3, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 3, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 3, 2025
@miss-islington-app

miss-islington-app Bot commented Sep 3, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 3, 2025
@encukou @blaisep
@AA-Turner @miss-islington
pythongh-135676: Reword the Operators & Delimiters section(s) (python…
600819d
…GH-137713)

(cherry picked from commit cfcfbdd)

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@bedevere-app

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 3, 2025
@encukou
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
@encukou @blaisep
@AA-Turner @lkollar
pythongh-135676: Reword the Operators & Delimiters section(s) (python…
12ea33f
…GH-137713)

Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
hugovk pushed a commit that referenced this pull request Sep 11, 2025
@miss-islington @encukou
@blaisep @AA-Turner
[3.14] gh-135676: Reword the Operators & Delimiters section(s) (GH-13…
15ca9c6
…7713) (#138457)

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner AA-Turner approved these changes
@willingc willingc Awaiting requested review from willingc willingc is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

An operator is missing in the list of tokens

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@encukou @AA-Turner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.