]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135676: Simplify docs on lexing names (GH-140464)
authorPetr Viktorin <encukou@gmail.com>
Wed, 26 Nov 2025 15:10:44 +0000 (16:10 +0100)
committerGitHub <noreply@github.com>
Wed, 26 Nov 2025 15:10:44 +0000 (16:10 +0100)
commit2ff8608b4da33f667960e5099a1a442197acaea4
tree5fe865eedb3b4c02d6b9bf7d89a93034ab34ee01
parentc359ea4c71ace06e4eeec6249660ebaecc1e8e27
gh-135676: Simplify docs on lexing names (GH-140464)

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

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>
Doc/reference/lexical_analysis.rst