Skip to content

Commit 91399c3

Browse files
miss-islingtonlubaskinc0deterryjreedytomasr8picnixz
authored
[3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#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]>
1 parent 7d175ca commit 91399c3

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
@@ -1139,6 +1139,7 @@ Mark Lutz
11391139
Taras Lyapun
11401140
Jim Lynch
11411141
Mikael Lyngvig
1142+
Ilya Lyubavski
11421143
Jeff MacDonald
11431144
John Machin
11441145
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)