misleading prefix ++

LuciferLeo at gmail.com LuciferLeo at gmail.com
Sat May 20 08:35:47 EDT 2006


given i = 0,
I know i = i + 1 and i += 1 are all correct
but when I type:
>>> i++
the interpreter replies:
  File "<stdin>", line 1
    i++
      ^
SyntaxError: invalid syntax

so I get the idea that suffix ++ is invalid in python
but when I input:
>>> ++i
and the interpreter replies
0

Don't you think it is misleading when you expect a variable to
increment?




More information about the Python-list mailing list