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
83dcf5a2
Commit
83dcf5a2
authored
Aug 07, 2002
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply character{} markup.
parent
3f19b10c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
Doc/ref/ref2.tex
Doc/ref/ref2.tex
+17
-16
No files found.
Doc/ref/ref2.tex
View file @
83dcf5a2
...
...
@@ -387,14 +387,14 @@ are generally referred to as \emph{triple-quoted strings}). The
backslash (
\code
{
\e
}
) character is used to escape characters that
otherwise have a special meaning, such as newline, backslash itself,
or the quote character. String literals may optionally be prefixed
with a letter
`r' or `R'; such strings are called
\dfn
{
raw
strings
}
\index
{
raw string
}
and use different rules for interpreting
backslash escape sequences. A prefix of
'u' or 'U' makes the string
a Unicode string. Unicode strings use the Unicode character set as
defined by the Unicode Consortium and ISO~10646. Some additional
with a letter
\character
{
r
}
or
\character
{
R
}
; such strings are called
\dfn
{
raw
strings
}
\index
{
raw string
}
and use different rules for interpreting
backslash escape sequences. A prefix of
\character
{
u
}
or
\character
{
U
}
makes the string a Unicode string. Unicode strings use the Unicode character
set as
defined by the Unicode Consortium and ISO~10646. Some additional
escape sequences, described below, are available in Unicode strings.
The two prefix characters may be combined; in this case,
`u'
must
appear before
`r'
.
The two prefix characters may be combined; in this case,
\character
{
u
}
must
appear before
\character
{
r
}
.
In triple-quoted strings,
unescaped newlines and quotes are allowed (and are retained), except
...
...
@@ -402,8 +402,8 @@ that three unescaped quotes in a row terminate the string. (A
``quote'' is the character used to open the string, i.e. either
\code
{
'
}
or
\code
{
"
}
.)
Unless an
`r' or `R' prefix is present, escape sequences in strings
are interpreted according to rules similar
Unless an
\character
{
r
}
or
\character
{
R
}
prefix is present, escape
sequences in strings
are interpreted according to rules similar
to those used by Standard C. The recognized escape sequences are:
\index
{
physical line
}
\index
{
escape sequence
}
...
...
@@ -443,12 +443,12 @@ 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, a character following a
backslash is included in the string without change, and
\emph
{
all
When an
\character
{
r
}
or
\character
{
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
\character
{
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 valid string literal (even a raw string cannot
end in an odd number of backslashes). Specifically,
\emph
{
a raw
...
...
@@ -537,9 +537,10 @@ lexical definitions:
{
\token
{
digit
}
| "a"..."f" | "A"..."F"
}
\end{productionlist}
Although both lower case `l' and upper case `L' are allowed as suffix
for long integers, it is strongly recommended to always use `L', since
the letter `l' looks too much like the digit `1'.
Although both lower case
\character
{
l
}
and upper case
\character
{
L
}
are
allowed as suffix for long integers, it is strongly recommended to always
use
\character
{
L
}
, since the letter
\character
{
l
}
looks too much like the
digit
\character
{
1
}
.
Plain integer decimal literals must be at most 2147483647 (i.e., the
largest positive integer, using 32-bit arithmetic). Plain octal and
...
...
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