Skip to content
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

gh-130587: Add hand-written docs for non-OP tokens #130588

Merged
merged 15 commits into from
Mar 19, 2025
Merged

Conversation

encukou
Copy link
Member

@encukou encukou commented Feb 26, 2025

  • Add hand-written docs for non-OP tokens

  • Make the automation (generate_token.py) check that the hand-written docs are present, and only generate docs for the OP tokens

  • Switch to list-table for the OP tokens, to make their docs more compact

  • Add ENDMARKER to the grammar docs where it appears (toplevel components)

  • Add forgotten versionchanged entry for EXCLAMATION

  • Remove docs for NT_OFFSET


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

@encukou
Copy link
Member Author

encukou commented Feb 26, 2025

@encukou
Copy link
Member Author

encukou commented Feb 26, 2025

@lysnikolaou, does this look reasonable to you?

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

This looks like a good improvement to me! Thanks @encukou!

I've left some inline comments regarding some specifics in the docs.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@encukou
Copy link
Member Author

encukou commented Feb 27, 2025

Thank you for the reviews! I addressed some; I'll continue next week.

Comment on lines +22 to +25
Note that a token's value may depend on tokenizer options. For example, a
``"+"`` token may be reported as either :data:`PLUS` or :data:`OP`, or
a ``"match"`` token may be either :data:`NAME` or :data:`SOFT_KEYWORD`.

Copy link
Member Author

@encukou encukou Mar 5, 2025

Choose a reason for hiding this comment

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

I added this note to clarify the “fuzziness” of these categories.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@encukou encukou merged commit 4bced29 into python:main Mar 19, 2025
39 checks passed
@encukou encukou deleted the token-docs branch March 19, 2025 15:42
@encukou encukou added the needs backport to 3.13 bugs and security fixes label Mar 19, 2025
@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4bced29a74c4dbcf310a47e8202292aaa39b617b 3.13

@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2025

GH-131465 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 19, 2025
encukou added a commit to encukou/cpython that referenced this pull request Mar 19, 2025
…0588)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
(cherry picked from commit 4bced29)
encukou added a commit to encukou/cpython that referenced this pull request Mar 19, 2025
…onGH-130588)

(cherry picked from commit 4bced29)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
encukou added a commit that referenced this pull request Mar 24, 2025
…GH-131465)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
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.

4 participants