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-127303: Add docs for token.EXACT_TOKEN_TYPES #127304

Merged
merged 9 commits into from
Nov 29, 2024

Conversation

lubaskinc0de
Copy link
Contributor

@lubaskinc0de lubaskinc0de commented Nov 26, 2024

Copy link

cpython-cla-bot bot commented Nov 26, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Nov 26, 2024
@Eclips4 Eclips4 added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 26, 2024
Copy link
Member

@Eclips4 Eclips4 left a 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 :(

Doc/library/token.rst Outdated Show resolved Hide resolved
Copy link
Member

@terryjreedy terryjreedy left a 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.

@bedevere-app
Copy link

bedevere-app bot commented Nov 26, 2024

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@lubaskinc0de
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented Nov 27, 2024

Thanks for making the requested changes!

@terryjreedy, @Eclips4: please review the changes made to this pull request.

Copy link
Member

@picnixz picnixz left a 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

Copy link
Member

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/ACKS Outdated Show resolved Hide resolved
@lubaskinc0de lubaskinc0de requested a review from picnixz November 27, 2024 15:23
Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

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

LGTM.

@terryjreedy terryjreedy merged commit dd3a87d into python:main Nov 29, 2024
40 of 41 checks passed
@miss-islington-app
Copy link

Thanks @lubaskinc0de for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2024
---------

(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]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2024

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2024
---------

(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]>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 29, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2024

GH-127391 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 29, 2024
terryjreedy added a commit that referenced this pull request Nov 29, 2024
…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]>
@lubaskinc0de lubaskinc0de deleted the issue/127303 branch November 29, 2024 10:47
terryjreedy added a commit that referenced this pull request Nov 30, 2024
…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]>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 MacOS Intel NoGIL 3.13 has failed when building commit 4cba0e6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1449/builds/718) and take a look at the build logs.
  4. Check if the failure is related to this commit (4cba0e6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1449/builds/718

Failed tests:

  • test_threading

Failed subtests:

  • test_start_new_thread_failed - test.test_threading.ThreadTests.test_start_new_thread_failed

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.13.itamaro-macos-intel-aws.nogil/build/Lib/test/test_threading.py", line 1205, in test_start_new_thread_failed
    self.assertEqual(out, b'ok')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: b"skip\nshouldn't be printed" != b'ok'

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
---------

Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Tomas R. <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
---------

Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Tomas R. <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
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.

6 participants