@@ -480,9 +480,11 @@ declaration is given in the source file; see section :ref:`encodings`.
480
480
In plain English: Both types of literals can be enclosed in matching single quotes
481
481
(``' ``) or double quotes (``" ``). They can also be enclosed in matching groups
482
482
of three single or double quotes (these are generally referred to as
483
- *triple-quoted strings *). The backslash (``\ ``) character is used to escape
484
- characters that otherwise have a special meaning, such as newline, backslash
485
- itself, or the quote character.
483
+ *triple-quoted strings *). The backslash (``\ ``) character is used to give special
484
+ meaning to otherwise ordinary characters like ``n ``, which means 'newline' when
485
+ escaped (``\n ``). It can also be used to escape characters that otherwise have a
486
+ special meaning, such as newline, backslash itself, or the quote character.
487
+ See :ref: `escape sequences <escape-sequences >` below for examples.
486
488
487
489
.. index ::
488
490
single: b'; bytes literal
@@ -541,6 +543,8 @@ retained), except that three unescaped quotes in a row terminate the literal. (
541
543
single: \u ; escape sequence
542
544
single: \U ; escape sequence
543
545
546
+ .. _escape-sequences :
547
+
544
548
Unless an ``'r' `` or ``'R' `` prefix is present, escape sequences in string and
545
549
bytes literals are interpreted according to rules similar to those used by
546
550
Standard C. The recognized escape sequences are:
0 commit comments