summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-02 22:06:35 +0100
committerGitHub <noreply@github.com>2024-02-02 21:06:35 +0000
commitdf5381d8b6eebf47a5469e66d4d4554683988bbc (patch)
treecd10dad78e6bdf0ac9dec3e1867a619526c1787b
parent[3.11] gh-114728: Fix documentation for comparison of objects in datetime mod... (diff)
downloadcpython-df5381d8b6eebf47a5469e66d4d4554683988bbc.tar.gz
cpython-df5381d8b6eebf47a5469e66d4d4554683988bbc.tar.bz2
cpython-df5381d8b6eebf47a5469e66d4d4554683988bbc.zip
[3.11] gh-103360: Add link in stdtypes.rst to escape sequences in lexical_analysis.rst (GH-103638) (#114908)
(cherry picked from commit d29f57f6036353b4e705a42637177442bf7e07e5) Co-authored-by: Justin Williams <97240811+juswil@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
-rw-r--r--Doc/library/stdtypes.rst2
-rw-r--r--Doc/reference/lexical_analysis.rst5
2 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 732c3145c87..db9815733fc 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1488,7 +1488,7 @@ between them will be implicitly converted to a single string literal. That
is, ``("spam " "eggs") == "spam eggs"``.
See :ref:`strings` for more about the various forms of string literal,
-including supported escape sequences, and the ``r`` ("raw") prefix that
+including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") prefix that
disables most escape sequence processing.
Strings may also be created from other objects using the :class:`str`
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index fa7608f94c3..384b854a987 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -541,6 +541,11 @@ retained), except that three unescaped quotes in a row terminate the literal. (
single: \u; escape sequence
single: \U; escape sequence
+.. _escape-sequences:
+
+Escape sequences
+^^^^^^^^^^^^^^^^
+
Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and
bytes literals are interpreted according to rules similar to those used by
Standard C. The recognized escape sequences are: