Skip to content

Commit 92ad3be

Browse files
miss-islingtonsobolevnAA-Turner
authored
[3.12] gh-122701: Fix wording of raw strings/bytes in lexical_analysis.rst (GH-122702) (#122915)
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (GH-122702) (cherry picked from commit ea70439) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent 18d4805 commit 92ad3be

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Doc/reference/lexical_analysis.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,10 @@ must be expressed with escapes.
503503
single: r"; raw string literal
504504

505505
Both string and bytes literals may optionally be prefixed with a letter ``'r'``
506-
or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as
507-
literal characters. As a result, in string literals, ``'\U'`` and ``'\u'``
508-
escapes in raw strings are not treated specially. Given that Python 2.x's raw
509-
unicode literals behave differently than Python 3.x's the ``'ur'`` syntax
510-
is not supported.
506+
or ``'R'``; such constructs are called :dfn:`raw string literals`
507+
and :dfn:`raw bytes literals` respectively and treat backslashes as
508+
literal characters. As a result, in raw string literals, ``'\U'`` and ``'\u'``
509+
escapes are not treated specially.
511510

512511
.. versionadded:: 3.3
513512
The ``'rb'`` prefix of raw bytes literals has been added as a synonym

0 commit comments

Comments
 (0)