gh-145642: Match tutorial output to real interpreter output#145643
gh-145642: Match tutorial output to real interpreter output#145643nedbat merged 2 commits intopython:mainfrom
Conversation
|
I should note that this update to the docs contains the text that matches Python 3.14's output, but on Python 3.12 and 3.13 the output is more terse: >>> print('C:\some\name')
<unknown>:1: SyntaxWarning: invalid escape sequence '\s'
C:\some
ameSo this change should not be backported to the docs for those versions as-is. If the docs for these older versions should also be updated, I can submit a separate PR. |
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
|
Reworked the example to avoid the invalid escape sequence, per discussion with @nedbat |
With |
Yep, output is the same on 3.13 and 3.14 so this can be backported. |
…utorial (pythonGH-145643) * Match tutorial output to real interpreter output * Avoid invalid escape sequence in example Co-authored-by: Ned Batchelder <ned@nedbatchelder.com> --------- (cherry picked from commit 5a15a52) Co-authored-by: James <snoopjedi@gmail.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
…utorial (pythonGH-145643) * Match tutorial output to real interpreter output * Avoid invalid escape sequence in example Co-authored-by: Ned Batchelder <ned@nedbatchelder.com> --------- (cherry picked from commit 5a15a52) Co-authored-by: James <snoopjedi@gmail.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
|
GH-145646 is a backport of this pull request to the 3.13 branch. |
|
GH-145647 is a backport of this pull request to the 3.14 branch. |
Closes #145642.
This changeset updates the official tutorial to match real interpreter output for an example that demonstrates escape sequences, namely showing the generated
SyntaxWarning.📚 Documentation preview 📚: https://cpython-previews--145643.org.readthedocs.build/