Skip to content

gh-148327: Update syntax error example in tutorial#148328

Open
blesson-07 wants to merge 5 commits intopython:mainfrom
blesson-07:main
Open

gh-148327: Update syntax error example in tutorial#148328
blesson-07 wants to merge 5 commits intopython:mainfrom
blesson-07:main

Conversation

@blesson-07
Copy link
Copy Markdown

@blesson-07 blesson-07 commented Apr 10, 2026

gh-148327: Update syntax error example in tutorial

Closes #148327

Replace the outdated syntax error example with a clearer one.
Update the syntax error example from while True print('Hello world') to a[1]] = 0, which gives a clearer unmatched ']' error and better shows arrow placement.

Clarify error message explanation for syntax errors.
Fix formatting issues in error message example
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot bot commented Apr 10, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@StanFromIreland
Copy link
Copy Markdown
Member

CC @erlend-aasland, per #30097 (comment)

Copy link
Copy Markdown
Contributor

@sharktide sharktide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, left one wording suggestion. Up to you if you want to take it :)

SyntaxError: unmatched ']'

The parser repeats the offending line and displays a little arrow pointing
at the earliest point in the line where the error was detected.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
at the earliest point in the line where the error was detected.
at the earliest point in the line in which the error was detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Docs: problem with page "8. Errors and Exceptions"

3 participants