Today I noticed that the Python interpreter treats consecutive repetitions of the addition operator as just one repetition of the operator. For example:
>>> 1 ++ 2
3
Of what use was it to not simply raise an error when such an event occurs? I find it much more believable that a programmer who typed
>>> 1 -+-++ 2
was just out of their mind; it would be highly unlikely that this ever intentionally appears in code.
It seems to serve no purpose, for writing something like
>>> +-1
simply returns -1
, demonstrating that the operation does not make the number positive, rather, it simply performs the identity operation.