
Feb. 14, 2015
6:16 a.m.
Chris Barker - NOAA Federal writes:
avoids any confusion over operators and having += duplicating the update method.
+= duplicates the extend method on lists.
And it's really redundant for numbers, too:
x += y
x = x + y
So plenty of precedent.
Except for the historical detail that Guido dislikes them! (Or did.) For a long time he resisted the extended assignment operators, insisting that x += 1 is best spelled x = x + 1 I forget whether he ever said "if you're worried about inefficiency of temp creation, figure out how to optimize the latter".