-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-135676: Simplify docs on lexing names #140464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Blaise Pabon <[email protected]> Co-authored-by: Micha Albert <[email protected]> Co-authored-by: KeithTheEE <[email protected]>
willingc
left a comment
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.
Outstanding document @encukou. I had one small suggestion to be a bit more explicit on the normalization example with number.
| This means that, for example, some typographic variants of characters are | ||
| converted to their "basic" form, for example:: | ||
|
|
||
| >>> nᵘₘᵇₑʳ = 3 |
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.
It would be helpful to add an explicit comment that the normalized form of nᵘₘᵇₑʳis number.
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.
Does this look good?
|
There was an insightful conversation in #140269. I'll update this PR to make things even clearer. |
willingc
left a comment
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.
Thanks @encukou
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:
id_start/id_continuesets (referred to in previous sections as “letter-like” and “number-like” characters, with a link to the details)This also means we don't need
xid_start/xid_continueto define the behaviour :)📚 Documentation preview 📚: https://cpython-previews--140464.org.readthedocs.build/