syntax error?why?

Alex Martelli aleaxit at yahoo.com
Fri Nov 3 07:51:37 EST 2000


"Carel Fellinger" <cfelling at iae.nl> wrote in message
news:8tu4u8$1e0$1 at animus.fel.iae.nl...
> Jack Tiger <JackTiger at sohu.com> wrote:
> > admin(8181):   File "../Mailman/Cgi/oz_sub.py", line 71
> >       results = results + "Can not subscribe itself!<br>"
> >       ^
> >   SyntaxError: invalid syntax
>
> A this abundunce of information you give us:)

Presumably the same amount the Python compiler gave him.

> This leaves us nothing but guessing, so here are my guesses:
>
> 1) wrongly indended code
> 2) forgotten colon (":") in the preceeding line
> 3) many other wrong doings

Right.  No way to tell, based on the information the
Python compiler is presenting to the user, is there?

Therefore, this must count as a bug of the Python
compiler -- it displays insufficient information
on these kinds of syntax errors (showing a couple
of extra previous lines would help, as would having
a message a TAD more informative than 'invalid
syntax'!-).  Quite unfriendly, especially to
beginning users of Python...


Alex






More information about the Python-list mailing list