Skip to content

Commit

Permalink
[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
5 people authored Nov 30, 2024
1 parent 2f56c68 commit 4cba0e6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
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


.. 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 @@ -1149,6 +1149,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

0 comments on commit 4cba0e6

Please sign in to comment.