Skip to content

Commit

Permalink
Added and linked to subheader "String escape sequences"
Browse files Browse the repository at this point in the history
This commit addresses issue python#103360 by adding a subsection header "String escape sequences" above the escape sequences table in lexical_analysis.rst, and referencing that subsection header in stdtypes.rst where the documentation mentions supported escape sequences under "Text Sequence Type - str".
  • Loading branch information
juswil committed Apr 20, 2023
1 parent 6be7aee commit 89f2eb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,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`
Expand Down
3 changes: 3 additions & 0 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ retained), except that three unescaped quotes in a row terminate the literal. (

.. _escape-sequences:

String 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:
Expand Down

0 comments on commit 89f2eb3

Please sign in to comment.