Skip to content

Commit 45de31d

Browse files
[3.10] Clarify the supported cases in the tokenize module (GH-105569) (#105575)
Co-authored-by: Pablo Galindo Salgado <[email protected]>
1 parent a23ff66 commit 45de31d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/library/tokenize.rst

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ the generic :data:`~token.OP` token type. The exact
2222
type can be determined by checking the ``exact_type`` property on the
2323
:term:`named tuple` returned from :func:`tokenize.tokenize`.
2424

25+
26+
.. warning::
27+
28+
Note that the functions in this module are only designed to parse
29+
syntactically valid Python code (code that does not raise when parsed
30+
using :func:`ast.parse`). The behavior of the functions in this module is
31+
**undefined** when providing invalid Python code and it can change at any
32+
point.
33+
2534
Tokenizing Input
2635
----------------
2736

0 commit comments

Comments
 (0)