]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Clarify the supported cases in the tokenize module (GH-105569) (#105573)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 9 Jun 2023 16:00:42 +0000 (09:00 -0700)
committerGitHub <noreply@github.com>
Fri, 9 Jun 2023 16:00:42 +0000 (16:00 +0000)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
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
 ----------------