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
7 changes: 7 additions & 0 deletions Doc/library/token.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ the :mod:`tokenize` module.
``type_comments=True``.


.. data:: EXACT_TOKEN_TYPES

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)


.. versionchanged:: 3.5
Added :data:`!AWAIT` and :data:`!ASYNC` tokens.

Expand Down
3 changes: 2 additions & 1 deletion Lib/token.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ Mark Lutz
Taras Lyapun
Jim Lynch
Mikael Lyngvig
Ilya Lyubavski
Jeff MacDonald
John Machin
Andrew I MacIntyre
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Publicly expose :data:`~token.EXACT_TOKEN_TYPES` in :attr:`!token.__all__`.
3 changes: 2 additions & 1 deletion Tools/build/generate_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def make_rst(infile, outfile='Doc/library/token-list.inc'):
# {AUTO_GENERATED_BY_SCRIPT}
'''
token_py_template += '''
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF',
'EXACT_TOKEN_TYPES']

%s
N_TOKENS = %d
Expand Down
Loading