Skip to content

[3.14] gh-135676: Simplify docs on lexing names (GH-140464)#142015

Merged
encukou merged 1 commit into
python:3.14from
StanFromIreland:backport-2ff8608-3.14
Dec 3, 2025
Merged

[3.14] gh-135676: Simplify docs on lexing names (GH-140464)#142015
encukou merged 1 commit into
python:3.14from
StanFromIreland:backport-2ff8608-3.14

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Nov 27, 2025

Copy link
Copy Markdown
Member

This simplifies the Lexical Analysis section on Names (but keeps it technically correct) by putting all the info about non-ASCII characters in a separate (and very technical) section.

It uses a mental model where the parser doesn't handle Unicode complexity “immediately”, but:

  • parses any non-ASCII character (outside strings/comments) as part of a name, since these can't (yet) be e.g. operators
  • normalizes the name
  • validates the name, using the xid_start/xid_continue sets

(cherry picked from commit 2ff8608)


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

This simplifies the Lexical Analysis section on Names (but keeps it technically correct) by putting all the info about non-ASCII characters in a separate (and very technical) section.

It uses a mental model where the parser doesn't handle Unicode complexity “immediately”, but:

- parses any non-ASCII character (outside strings/comments) as part of a name, since these can't (yet) be e.g. operators
- normalizes the name
- validates the name, using the xid_start/xid_continue sets

(cherry picked from commit 2ff8608)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Micha Albert <info@micha.zone>
Co-authored-by: KeithTheEE <kmurrayis@gmail.com>
Comment on lines +593 to +594
.. _PropList.txt: https://www.unicode.org/Public/16.0.0/ucd/PropList.txt
.. _DerivedCoreProperties.txt: https://www.unicode.org/Public/16.0.0/ucd/DerivedCoreProperties.txt

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(un-)updated these to UCD 16.0.0.

@encukou

encukou commented Dec 3, 2025

Copy link
Copy Markdown
Member

Thank you!

@encukou encukou merged commit 79245a4 into python:3.14 Dec 3, 2025
36 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Dec 3, 2025
@StanFromIreland StanFromIreland deleted the backport-2ff8608-3.14 branch December 3, 2025 13:20
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.

2 participants