From 97d846dc2b6a790298cbfbb5669d180281cfda89 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 9 Jun 2023 09:00:42 -0700 Subject: [3.12] Clarify the supported cases in the tokenize module (GH-105569) (#105573) Co-authored-by: Pablo Galindo Salgado --- Doc/library/tokenize.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 41222a7..bffe930 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -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 ---------------- -- cgit v0.12