summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-01-09 21:38:16 (GMT)
committerFred Drake <fdrake@acm.org>2001-01-09 21:38:16 (GMT)
commit347a62505c34f17c8fc6eac1197ba5c7654dd6e4 (patch)
treee5b686035cf92b47f7a349b3a788bbb45fd674dd
parentd5f0198dece0946a882316684e70c9974015286b (diff)
downloadcpython-347a62505c34f17c8fc6eac1197ba5c7654dd6e4.zip
cpython-347a62505c34f17c8fc6eac1197ba5c7654dd6e4.tar.gz
cpython-347a62505c34f17c8fc6eac1197ba5c7654dd6e4.tar.bz2
Steve Holden <sholden@holdenweb.com>:
Clarify the handling of characters following backslashes in raw strings.
-rw-r--r--Doc/ACKS1
-rw-r--r--Doc/ref/ref2.tex26
2 files changed, 14 insertions, 13 deletions
diff --git a/Doc/ACKS b/Doc/ACKS
index 746f424..b4bbc3f 100644
--- a/Doc/ACKS
+++ b/Doc/ACKS
@@ -63,6 +63,7 @@ Konrad Hinsen
Stefan Hoffmeister
Albert Hofkamp
Gregor Hoffleit
+Steve Holden
Gerrit Holl
Rob Hooft
Brian Hooper
diff --git a/Doc/ref/ref2.tex b/Doc/ref/ref2.tex
index 43e508e..d1503b4 100644
--- a/Doc/ref/ref2.tex
+++ b/Doc/ref/ref2.tex
@@ -372,19 +372,19 @@ important to note that the escape sequences marked as ``(Unicode
only)'' in the table above fall into the category of unrecognized
escapes for non-Unicode string literals.
-When an `r' or `R' prefix is present, backslashes are still used to
-quote the following character, but \emph{all backslashes are left in
-the string}. For example, the string literal \code{r"\e n"} consists
-of two characters: a backslash and a lowercase `n'. String quotes can
-be escaped with a backslash, but the backslash remains in the string;
-for example, \code{r"\e""} is a valid string literal consisting of two
-characters: a backslash and a double quote; \code{r"\e"} is not a value
-string literal (even a raw string cannot end in an odd number of
-backslashes). Specifically, \emph{a raw string cannot end in a single
-backslash} (since the backslash would escape the following quote
-character). Note also that a single backslash followed by a newline
-is interpreted as those two characters as part of the string,
-\emph{not} as a line continuation.
+When an `r' or `R' prefix is present, a character following a
+backslash is included in the string without change, and \emph{all
+backslashes are left in the string}. For example, the string literal
+\code{r"\e n"} consists of two characters: a backslash and a lowercase
+`n'. String quotes can be escaped with a backslash, but the backslash
+remains in the string; for example, \code{r"\e""} is a valid string
+literal consisting of two characters: a backslash and a double quote;
+\code{r"\e"} is not a value string literal (even a raw string cannot
+end in an odd number of backslashes). Specifically, \emph{a raw
+string cannot end in a single backslash} (since the backslash would
+escape the following quote character). Note also that a single
+backslash followed by a newline is interpreted as those two characters
+as part of the string, \emph{not} as a line continuation.
\subsection{String literal concatenation\label{string-catenation}}