[Python-Dev] why do we allow this syntax? (original) (raw)
Oscar Benjamin oscar.j.benjamin at gmail.com
Fri Feb 8 16:52:46 CET 2013
- Previous message: [Python-Dev] why do we allow this syntax?
- Next message: [Python-Dev] why do we allow this syntax?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 8 February 2013 15:39, Chris Withers <chris at simplistix.co.uk> wrote:
Hi All,
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...
Because '+' can represent an unary prefix operator just the same as '-':
+ + -- ++- +- -+ ++3 -3
Oscar
- Previous message: [Python-Dev] why do we allow this syntax?
- Next message: [Python-Dev] why do we allow this syntax?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]