Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Casing; 3 dots for character ranges
  • Loading branch information
encukou committed Oct 22, 2025
commit 6163c24f21edf615c4066de1a721f5a48a9d7092
12 changes: 6 additions & 6 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ Names (identifiers and keywords)

Names are composed of the following characters:

* Uppercase and lowercase letters (``A-Z`` and ``a-z``)
* The underscore (``_``)
* Digits (``0`` through ``9``), which cannot appear as the first character
* Non-ASCII characters. Valid names may only contain "letter-like" and
* uppercase and lowercase letters (``A-Z`` and ``a-z``),
* the underscore (``_``),
* digits (``0`` through ``9``), which cannot appear as the first character, and
* non-ASCII characters. Valid names may only contain "letter-like" and
"digit-like" characters; see :ref:`lexical-names-nonascii` for details.

Names must contain at least one character, but have no upper length limit.
Expand All @@ -403,8 +403,8 @@ Formally, names are described by the following lexical definitions:
:group: python-grammar

NAME: `name_start` `name_continue`*
name_start: "a".."z" | "A".."Z" | "_" | <non-ASCII character>
name_continue: name_start | "0".."9"
name_start: "a"..."z" | "A"..."Z" | "_" | <non-ASCII character>
name_continue: name_start | "0"..."9"
identifier: <`NAME`, except keywords>

Note that not all names matched by this grammar are valid; see
Expand Down