]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify the supported cases in the tokenize module (#105569)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 9 Jun 2023 15:59:37 +0000 (16:59 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Jun 2023 15:59:37 +0000 (16:59 +0100)
Doc/library/tokenize.rst

index 41222a771d1b47dc35908f822a8e493a7dd6f944..bffe93006edc7bcf9b9aab42abb688eb568babd3 100644 (file)
@@ -22,6 +22,15 @@ the generic :data:`~token.OP` token type.  The exact
 type can be determined by checking the ``exact_type`` property on the
 :term:`named tuple` returned from :func:`tokenize.tokenize`.
 
+
+.. warning::
+
+   Note that the functions in this module are only designed to parse
+   syntactically valid Python code (code that does not raise when parsed
+   using :func:`ast.parse`).  The behavior of the functions in this module is
+   **undefined** when providing invalid Python code and it can change at any
+   point.
+
 Tokenizing Input
 ----------------