aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2024-03-11 18:01:08 -0400
committerGitHub <noreply@github.com>2024-03-11 18:01:08 -0400
commit3e45030076bf2cfab41c4456c73fb212b7322c60 (patch)
tree6d0484abe6c939b73a436f6acfe97dc0697677e6
parentgh-90095: Make .pdbrc work properly and add some reasonable tests (#110496) (diff)
downloadcpython-3e45030076bf2cfab41c4456c73fb212b7322c60.tar.gz
cpython-3e45030076bf2cfab41c4456c73fb212b7322c60.tar.bz2
cpython-3e45030076bf2cfab41c4456c73fb212b7322c60.zip
gh-116563: Update tutorial error example (#116569)
There now may be multiple carets pointing at a token rather than just a character. Fix the sentence about possible causes.
-rw-r--r--Doc/tutorial/errors.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index 4058ebe8efd..0b9acd00fdc 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -20,12 +20,12 @@ complaint you get while you are still learning Python::
>>> while True print('Hello world')
File "<stdin>", line 1
while True print('Hello world')
- ^
+ ^^^^^
SyntaxError: invalid syntax
-The parser repeats the offending line and displays a little 'arrow' pointing at
-the earliest point in the line where the error was detected. The error is
-caused by (or at least detected at) the token *preceding* the arrow: in the
+The parser repeats the offending line and displays little 'arrow's pointing
+at the token in the line where the error was detected. The error may be
+caused by the absence of a token *before* the indicated token. In the
example, the error is detected at the function :func:`print`, since a colon
(``':'``) is missing before it. File name and line number are printed so you
know where to look in case the input came from a script.