@@ -423,8 +423,9 @@ characters that otherwise have a special meaning, such as newline, backslash
423423itself, or the quote character.
424424
425425String literals may optionally be prefixed with a letter ``'r' `` or ``'R' ``;
426- such strings are called :dfn: `raw strings ` and use different rules for
427- interpreting backslash escape sequences.
426+ such strings are called :dfn: `raw strings ` and treat backslashes as literal
427+ characters. As a result, ``'\U' `` and ``'\u' `` escapes in raw strings are not
428+ treated specially.
428429
429430Bytes literals are always prefixed with ``'b' `` or ``'B' ``; they produce an
430431instance of the :class: `bytes ` type instead of the :class: `str ` type. They
@@ -520,15 +521,6 @@ is more easily recognized as broken.) It is also important to note that the
520521escape sequences only recognized in string literals fall into the category of
521522unrecognized escapes for bytes literals.
522523
523- When an ``'r' `` or ``'R' `` prefix is used in a string literal, then the
524- ``\uXXXX `` and ``\UXXXXXXXX `` escape sequences are processed while *all other
525- backslashes are left in the string *. For example, the string literal
526- ``r"\u0062\n" `` consists of three Unicode characters: 'LATIN SMALL LETTER B',
527- 'REVERSE SOLIDUS', and 'LATIN SMALL LETTER N'. Backslashes can be escaped with a
528- preceding backslash; however, both remain in the string. As a result,
529- ``\uXXXX `` escape sequences are only recognized when there is an odd number of
530- backslashes.
531-
532524Even in a raw string, string quotes can be escaped with a backslash, but the
533525backslash remains in the string; for example, ``r"\"" `` is a valid string
534526literal consisting of two characters: a backslash and a double quote; ``r"\" ``
0 commit comments