summaryrefslogtreecommitdiffstats
path: root/Doc/reference/lexical_analysis.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-08 19:34:08 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-09-08 19:34:08 (GMT)
commit110b6fecbbb86143a4acb568f50eab2c870e7d34 (patch)
treeccc11fe14604c7c08bb750b392f67559a3cfd962 /Doc/reference/lexical_analysis.rst
parent186122ead26f3ae4c2bc9f6715d2a29d339fdc5a (diff)
downloadcpython-110b6fecbbb86143a4acb568f50eab2c870e7d34.zip
cpython-110b6fecbbb86143a4acb568f50eab2c870e7d34.tar.gz
cpython-110b6fecbbb86143a4acb568f50eab2c870e7d34.tar.bz2
#27364: Deprecate invalid escape strings in str/byutes.
Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
Diffstat (limited to 'Doc/reference/lexical_analysis.rst')
-rw-r--r--Doc/reference/lexical_analysis.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index b3b71af..48f2043 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -560,6 +560,10 @@ is more easily recognized as broken.) It is also important to note that the
escape sequences only recognized in string literals fall into the category of
unrecognized escapes for bytes literals.
+ .. versionchanged:: 3.6
+ Unrecognized escape sequences produce a DeprecationWarning. In
+ some future version of Python they will be a SyntaxError.
+
Even in a raw literal, quotes can be escaped with a backslash, but the
backslash remains in the result; for example, ``r"\""`` is a valid string
literal consisting of two characters: a backslash and a double quote; ``r"\"``