-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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-127303: Add docs for token.EXACT_TOKEN_TYPES #127304
Conversation
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.
LGTM. Ilya and I checked that it was added in version 3.8. Although I'm a bit unsure about the wording, I think it could be improved, but neither I nor Ilya are native English speakers :(
Co-authored-by: Tomas R. <[email protected]>
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.
Now that it is documented, EXACT_TOKEN_TYPES needs to be added to __all__
at the top of token.py. In particular, line 4, which should then be wrapped to 2 lines.
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF',
'EXACT_TOKEN_TYPES']
EDIT: The complication is that token.py is auto-generated by Tools/build/generate_token.py, so it is the latter that needs revision. In particular, expand line 229 of that file to 2 lines.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again |
Thanks for making the requested changes! @terryjreedy, @Eclips4: please review the changes made to this pull request. |
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.
While the attribute already existed its scope was not specifically public. Now we can really stress that it's public and documented.
A dictionary mapping the string representation of a token to its numeric code. | ||
|
||
.. versionadded:: 3.8 | ||
|
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.
Can we have two blank lines here? (as above)
Misc/NEWS.d/next/Library/2024-11-27-16-06-10.gh-issue-127303.asqkgh.rst
Outdated
Show resolved
Hide resolved
…sqkgh.rst Co-authored-by: Bénédikt Tran <[email protected]>
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.
LGTM.
Thanks @lubaskinc0de for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
--------- (cherry picked from commit dd3a87d) Co-authored-by: Илья Любавский <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
GH-127390 is a backport of this pull request to the 3.13 branch. |
--------- (cherry picked from commit dd3a87d) Co-authored-by: Илья Любавский <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
GH-127391 is a backport of this pull request to the 3.12 branch. |
…127391) gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) --------- (cherry picked from commit dd3a87d) Co-authored-by: Илья Любавский <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
…127390) gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) --------- (cherry picked from commit dd3a87d) Co-authored-by: Илья Любавский <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
|
--------- Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
--------- Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
token.EXACT_TOKEN_TYPES
#127303📚 Documentation preview 📚: https://cpython-previews--127304.org.readthedocs.build/