Skip to content

Commit 6779fd8

Browse files
lubaskinc0deterryjreedytomasr8picnixz
authored andcommitted
pythongh-127303: Add docs for token.EXACT_TOKEN_TYPES (python#127304)
--------- Co-authored-by: Terry Jan Reedy <[email protected]> Co-authored-by: Tomas R. <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 91e8fd1 commit 6779fd8

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

Doc/library/token.rst

+7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ the :mod:`tokenize` module.
7979
``type_comments=True``.
8080

8181

82+
.. data:: EXACT_TOKEN_TYPES
83+
84+
A dictionary mapping the string representation of a token to its numeric code.
85+
86+
.. versionadded:: 3.8
87+
88+
8289
.. versionchanged:: 3.5
8390
Added :data:`!AWAIT` and :data:`!ASYNC` tokens.
8491

Lib/token.py

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/ACKS

+1
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ Mark Lutz
11541154
Taras Lyapun
11551155
Jim Lynch
11561156
Mikael Lyngvig
1157+
Ilya Lyubavski
11571158
Jeff MacDonald
11581159
John Machin
11591160
Andrew I MacIntyre
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Publicly expose :data:`~token.EXACT_TOKEN_TYPES` in :attr:`!token.__all__`.

Tools/build/generate_token.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def make_rst(infile, outfile='Doc/library/token-list.inc'):
226226
# {AUTO_GENERATED_BY_SCRIPT}
227227
'''
228228
token_py_template += '''
229-
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
229+
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF',
230+
'EXACT_TOKEN_TYPES']
230231
231232
%s
232233
N_TOKENS = %d

0 commit comments

Comments
 (0)