]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (#145643)
authorJames <snoopjedi@gmail.com>
Sun, 8 Mar 2026 22:41:47 +0000 (18:41 -0400)
committerGitHub <noreply@github.com>
Sun, 8 Mar 2026 22:41:47 +0000 (18:41 -0400)
* Match tutorial output to real interpreter output

* Avoid invalid escape sequence in example

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
---------

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Doc/tutorial/introduction.rst

index deabac5253051c6f94540e3414d0fabcc4091298..7778e37a9adaa9550b7753c40ce231931ee64d0f 100644 (file)
@@ -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