]> granicus.if.org Git - python/commitdiff
Steve Holden <sholden@holdenweb.com>:
authorFred Drake <fdrake@acm.org>
Tue, 9 Jan 2001 21:38:16 +0000 (21:38 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 9 Jan 2001 21:38:16 +0000 (21:38 +0000)
Clarify the handling of characters following backslashes in raw strings.

Doc/ACKS
Doc/ref/ref2.tex

index 746f424a50c724d1ba3c3f8fea7881184ba333c2..b4bbc3fbcd4f0fb32520c5b422ce6421102943a8 100644 (file)
--- 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
index 43e508ed0d30435b987055fc377f35874e5a126d..d1503b42604ccca27af718818db67393a7b44c66 100644 (file)
@@ -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}}