Python needs better error reporting

Fredrik Lundh fredrik at pythonware.com
Tue Jul 2 15:23:42 EDT 2002


Hans-Joachim Widmaier wrote:

> Instead of listing all the legitimate tokens that may follow, why not
> just give something like "Incomplete 'if' statement?"

of course, if you bother to read the *entire* error message,
that's not too far from what it says today:

      File "<stdin>", line 1
        if s == ""
                 ^
    SyntaxError: invalid syntax

(and the fact that your typical Python autoindenter
refuses to indent the next line if you leave out the
colon may also help; I usually discover mistakes like
this long before I run the code...)

</F>





More information about the Python-list mailing list