From 806f9d704fa90d334c77a649ed59c1f4c4bdcea7 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 7 Jun 2014 17:47:41 -0700 Subject: [PATCH] document TokenError and unclosed expression behavior (closes #12063) Patch by Amandine Lee. --- Doc/library/tokenize.rst | 18 ++++++++++++++++++ Misc/ACKS | 1 + 2 files changed, 19 insertions(+) diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 0fc0d7ef1b..3f25a2cbc0 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -98,6 +98,24 @@ back the modified script. .. versionadded:: 2.5 +.. exception:: TokenError + + Raised when either a docstring or expression that may be split over several + lines is not completed anywhere in the file, for example:: + + """Beginning of + docstring + + or:: + + [1, + 2, + 3 + +Note that unclosed single-quoted strings do not cause an error to be +raised. They are tokenized as ``ERRORTOKEN``, followed by the tokenization of +their contents. + Example of a script re-writer that transforms float literals into Decimal objects:: diff --git a/Misc/ACKS b/Misc/ACKS index f6449ba873..d16f1cd165 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -750,6 +750,7 @@ Julia Lawall Chris Lawrence Brian Leair Mathieu Leduc-Hamel +Amandine Lee Christopher Lee Inyeol Lee James Lee -- 2.50.1