[Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.21,1.22

Fred L. Drake python-dev@python.org
Tue, 09 Jan 2001 13:38:18 -0800


Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv17100/ref

Modified Files:
	ref2.tex 
Log Message:

Steve Holden <sholden@holdenweb.com>:
Clarify the handling of characters following backslashes in raw strings.


Index: ref2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** ref2.tex	2000/12/19 04:52:03	1.21
--- ref2.tex	2001/01/09 21:38:16	1.22
***************
*** 373,389 ****
  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.
  
  \subsection{String literal concatenation\label{string-catenation}}
--- 373,389 ----
  escapes for non-Unicode string literals.
  
! 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}}