]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Wed, 3 Dec 2025 12:43:06 +0000 (12:43 +0000)
committerGitHub <noreply@github.com>
Wed, 3 Dec 2025 12:43:06 +0000 (13:43 +0100)
commit79245a47ed127c14f63e1450a1b554d86c266a5d
treeb1d052b69f064289d6637940387cb04d48c1577f
parent206f1966ec51855313a60c1d70775ea43ee694d9
[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)

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 2ff8608b4da33f667960e5099a1a442197acaea4)

Co-authored-by: Petr Viktorin <encukou@gmail.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