On 2013-02-08, at 16:39 , Chris Withers wrote:
Just had a bit of an embarrassing incident in some code where I did:
sometotal =+ somevalue
I'm curious why this syntax is allowed? I'm sure there are good reasons, but thought I'd ask…
sometotal = (expression) is valid syntax, and +value is valid syntax.
Thus what you wrote is perfectly normal syntax, it's the assignment of a pos'd value, badly formatted. pep8.py will warn against it (it'll complain that the whitespace around `+` is wonky). But I see no justification for disallowing this, anymore than for disallowing the rougly equivalent (and just as error-prone) `sometotal = -somevalue`.