summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorStanley <46876382+slateny@users.noreply.github.com>2022-12-28 05:30:42 (GMT)
committerGitHub <noreply@github.com>2022-12-28 05:30:42 (GMT)
commitb95b1b3b25b0a93a22c7d58ac5bd5870e62070a8 (patch)
tree4bd7d67df5ced8c08b707288a530293fb2e4dfae /Doc/tutorial
parent5369bba8c594de7a643408550e19e1ff6df5178a (diff)
downloadcpython-b95b1b3b25b0a93a22c7d58ac5bd5870e62070a8.zip
cpython-b95b1b3b25b0a93a22c7d58ac5bd5870e62070a8.tar.gz
cpython-b95b1b3b25b0a93a22c7d58ac5bd5870e62070a8.tar.bz2
gh-55688: Add note about ending backslashes for raw strings (#94768)
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/introduction.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 6532a4e..ebc2e91 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -189,6 +189,11 @@ the first quote::
>>> print(r'C:\some\name') # note the r before the quote
C:\some\name
+There is one subtle aspect to raw strings: a raw string may not end in
+an odd number of ``\`` characters; see
+:ref:`the FAQ entry <faq-programming-raw-string-backslash>` for more information
+and workarounds.
+
String literals can span multiple lines. One way is using triple-quotes:
``"""..."""`` or ``'''...'''``. End of lines are automatically
included in the string, but it's possible to prevent this by adding a ``\`` at