Python needs better error reporting

Brian Quinlan brian at sweetapp.com
Sat Jun 29 04:42:29 EDT 2002


David LeBlanc wrote:
> Cute anthropomorphism is lots of fun, but doesn't _quite_ obscure the
fact
> that computers don't really "tell" anybody anything, programmers do.
IIRC,
> Python throws this "Syntax Error: invalid syntax" in a number of
places.
> In the place that I used as an example, looking at the language
reference,
> an appropriate error would be more like:
> 	Syntax Error: expected "and", "or", "xor" or ":"

There are a lot more tokens than that allowed. What about "+", "*", "\",
etc?
 
> This would at least narrow down what should be looked at to resolve
the
> problem.

> Vague error reporting doesn't help new user's self confidance or
> acceptance of the language.
> 
> I really DO have a point!

Probably. Figure out how to add more meaningful syntax errors and submit
a patch. Good luck!

Cheers,
Brian






More information about the Python-list mailing list