From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 11 Aug 2024 21:09:13 +0000 (+0200) Subject: [3.12] gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (GH... X-Git-Tag: v3.12.6~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92ad3be09b0b34e2604202bc19fae7ea9bb28690;p=thirdparty%2FPython%2Fcpython.git [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 ea70439bd2b5a1c881342646f30942f527f61373) Co-authored-by: sobolevn Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index e9b1c2733aaa..44d99b438c1b 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -503,11 +503,10 @@ must be expressed with escapes. single: r"; raw string literal 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 -literal characters. As a result, in string literals, ``'\U'`` and ``'\u'`` -escapes in raw strings are not treated specially. Given that Python 2.x's raw -unicode literals behave differently than Python 3.x's the ``'ur'`` syntax -is not supported. +or ``'R'``; such constructs are called :dfn:`raw string literals` +and :dfn:`raw bytes literals` respectively and treat backslashes as +literal characters. As a result, in raw string literals, ``'\U'`` and ``'\u'`` +escapes are not treated specially. .. versionadded:: 3.3 The ``'rb'`` prefix of raw bytes literals has been added as a synonym