https://github.com/python/cpython/commit/d91063841814b9581d794a81d9c9cde19f30b0ba commit: d91063841814b9581d794a81d9c9cde19f30b0ba branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: picnixz <[email protected]> date: 2026-03-09T00:05:09+01:00 summary:
[3.14] gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643) (#145647) gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643) --------- (cherry picked from commit 5a15a52dd1dee37af4f2b3a6b15a9f5735f75c6e) Co-authored-by: James <[email protected]> Co-authored-by: Ned Batchelder <[email protected]> files: M Doc/tutorial/introduction.rst diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst index deabac5253051c..7778e37a9adaa9 100644 --- a/Doc/tutorial/introduction.rst +++ b/Doc/tutorial/introduction.rst @@ -184,11 +184,11 @@ If you don't want characters prefaced by ``\`` to be interpreted as special characters, you can use *raw strings* by adding an ``r`` before the first quote:: - >>> print('C:\some\name') # here \n means newline! - C:\some + >>> print('C:\this\name') # here \t means tab, \n means newline + C: his ame - >>> print(r'C:\some\name') # note the r before the quote - C:\some\name + >>> print(r'C:\this\name') # note the r before the quote + C:\this\name There is one subtle aspect to raw strings: a raw string may not end in an odd number of ``\`` characters; see _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
