Issue 400734: more helpful SyntaxError messages (original) (raw)

Issue400734

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/32518

classification

Title: more helpful SyntaxError messages
Type: Stage:
Components: None Versions:

process

Status: closed Resolution:
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, ping
Priority: normal Keywords: patch

Created on 2000-07-05 10:44 by ping, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None ping,2000-07-05 10:44 None
Messages (5)
msg33044 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2000-07-05 10:44
msg33045 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-07-11 17:53
Checked in as part of patch #100856.
msg33046 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2000-07-05 10:56
This patch provides more helpful messages in SyntaxErrors that are caused by indentation problems. In doing so, it lets the err_input routine in pythonrun.c know which token caused the error and what token type is expected, which would enable it to produce other kinds of detailed messages in the future (e.g. "expected a right parenthesis here") even though such messages have not been added in this patch.
msg33047 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2000-07-05 10:57
The new messages are: SyntaxError: expected indent here SyntaxError: expected dedent here SyntaxError: unexpected indent SyntaxError: unexpected dedent SyntaxError: dedent does not match any outer indentation level SyntaxError: too many levels of indentation which would have previously only said "invalid syntax" or "invalid token".
msg33048 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2000-07-06 17:26
Updated error messages to say "unindent" instead of "dedent". The messages are now: expected an indented block unexpected indent unexpected unindent unindent does not match any outer indentation level
History
Date User Action Args
2022-04-10 16:02:03 admin set github: 32518
2000-07-05 10:44:10 ping create