Possible Duplicate:
Python: Behaviour of increment and decrement operators
>>> a=2
>>> ++a
2
>>> a++
Traceback ( File "<interactive input>", line 1
a++
^
SyntaxError: invalid syntax
>>> ++a
2
why ++x is OK?
(I’m asking since someone at work habitually wrote ++i, which didn’t do as (habitually) expected, but didn’t throw an error either, so it took some time to find the bug.)
It means
+(+a), i.e. opposite to the meaning of-(-a)(although obviously in this case, the result is the same!)See http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex.