@@ -480,9 +480,11 @@ declaration is given in the source file; see section :ref:`encodings`.
480480In plain English: Both types of literals can be enclosed in matching single quotes
481481(``' ``) or double quotes (``" ``). They can also be enclosed in matching groups
482482of 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.
486488
487489.. index ::
488490 single: b'; bytes literal
@@ -541,6 +543,8 @@ retained), except that three unescaped quotes in a row terminate the literal. (
541543 single: \u ; escape sequence
542544 single: \U ; escape sequence
543545
546+ .. _escape-sequences :
547+
544548Unless an ``'r' `` or ``'R' `` prefix is present, escape sequences in string and
545549bytes literals are interpreted according to rules similar to those used by
546550Standard C. The recognized escape sequences are:
0 commit comments