[Python-Dev] why do we allow this syntax?
Chris Angelico
rosuav at gmail.com
Fri Feb 8 16:42:57 CET 2013
More information about the Python-Dev mailing list
Fri Feb 8 16:42:57 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 Sat, Feb 9, 2013 at 2:39 AM, 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... For the same reason that you can negate a value with: sometotal = -somevalue The unary + and - operators are seldom problematic. ChrisA
- 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 ]
More information about the Python-Dev mailing list