always raise syntax error!

Steven D'Aprano steve at
Fri Oct 13 08:37:26 CEST 2006

On Thu, 12 Oct 2006 23:25:58 -0700, daniel wrote:

> I'm not quite new to this language, but such error has never happened
> so frequently before. I have no idea what to do about it, because
> there's actually no syntax error at all !!

Looking into my crystal ball, I see that you are correct, there is no
syntax error -- because there is no code! There might not even be a
computer. It is all an illusion brought on by lack of fresh air.

Or maybe not -- my crystal ball is notoriously unreliable. 

How about you post the FULL traceback of the error, so we can see for
ourselves if there is a syntax error or not?


>>> x{4} = 5
  File "<stdin>", line 1
    x{4} = 5
SyntaxError: invalid syntax


More information about the Python-list mailing list