Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
347a6250
Commit
347a6250
authored
Jan 09, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Steve Holden <sholden@holdenweb.com>:
Clarify the handling of characters following backslashes in raw strings.
parent
d5f0198d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
Doc/ACKS
Doc/ACKS
+1
-0
Doc/ref/ref2.tex
Doc/ref/ref2.tex
+13
-13
No files found.
Doc/ACKS
View file @
347a6250
...
@@ -63,6 +63,7 @@ Konrad Hinsen
...
@@ -63,6 +63,7 @@ Konrad Hinsen
Stefan Hoffmeister
Stefan Hoffmeister
Albert Hofkamp
Albert Hofkamp
Gregor Hoffleit
Gregor Hoffleit
Steve Holden
Gerrit Holl
Gerrit Holl
Rob Hooft
Rob Hooft
Brian Hooper
Brian Hooper
...
...
Doc/ref/ref2.tex
View file @
347a6250
...
@@ -372,19 +372,19 @@ important to note that the escape sequences marked as ``(Unicode
...
@@ -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
only)'' in the table above fall into the category of unrecognized
escapes for non-Unicode string literals.
escapes for non-Unicode string literals.
When an `r' or `R' prefix is present,
backslashes are still used to
When an `r' or `R' prefix is present,
a character following a
quote the following character, but
\emph
{
all backslashes are left in
backslash is included in the string without change, and
\emph
{
all
the string
}
. For example, the string literal
\code
{
r"
\e
n"
}
consists
backslashes are left in the string
}
. For example, the string literal
of two characters: a backslash and a lowercase `n'. String quotes can
\code
{
r"
\e
n"
}
consists of two characters: a backslash and a lowercase
be escaped with a backslash, but the backslash remains in the string;
`n'. String quotes can be escaped with a backslash, but the backslash
for example,
\code
{
r"
\e
""
}
is a valid string literal consisting of two
remains in the string; for example,
\code
{
r"
\e
""
}
is a valid string
characters: a backslash and a double quote;
\code
{
r"
\e
"
}
is not a value
literal consisting of two characters: a backslash and a double quote;
string literal (even a raw string cannot end in an odd number of
\code
{
r"
\e
"
}
is not a value string literal (even a raw string cannot
backslashes). Specifically,
\emph
{
a raw string cannot end in a single
end in an odd number of backslashes). Specifically,
\emph
{
a raw
backslash
}
(since the backslash would escape the following quote
string cannot end in a single backslash
}
(since the backslash would
character). Note also that a single backslash followed by a newlin
e
escape the following quote character). Note also that a singl
e
is interpreted as those two characters as part of the string,
backslash followed by a newline is interpreted as those two characters
\emph
{
not
}
as a line continuation.
as part of the string,
\emph
{
not
}
as a line continuation.
\subsection
{
String literal concatenation
\label
{
string-catenation
}}
\subsection
{
String literal concatenation
\label
{
string-catenation
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment