mirror of
https://github.com/python/cpython.git
synced 2025-09-28 11:15:17 +00:00
[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 ea70439bd2
)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
18d48052c2
commit
92ad3be09b
1 changed files with 4 additions and 5 deletions
|
@ -503,11 +503,10 @@ must be expressed with escapes.
|
||||||
single: r"; raw string literal
|
single: r"; raw string literal
|
||||||
|
|
||||||
Both string and bytes literals may optionally be prefixed with a letter ``'r'``
|
Both string and bytes literals may optionally be prefixed with a letter ``'r'``
|
||||||
or ``'R'``; such strings are called :dfn:`raw strings` and treat backslashes as
|
or ``'R'``; such constructs are called :dfn:`raw string literals`
|
||||||
literal characters. As a result, in string literals, ``'\U'`` and ``'\u'``
|
and :dfn:`raw bytes literals` respectively and treat backslashes as
|
||||||
escapes in raw strings are not treated specially. Given that Python 2.x's raw
|
literal characters. As a result, in raw string literals, ``'\U'`` and ``'\u'``
|
||||||
unicode literals behave differently than Python 3.x's the ``'ur'`` syntax
|
escapes are not treated specially.
|
||||||
is not supported.
|
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
The ``'rb'`` prefix of raw bytes literals has been added as a synonym
|
The ``'rb'`` prefix of raw bytes literals has been added as a synonym
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue