
June 1, 2011
11:47 p.m.
Steven D'Aprano wrote:
Carl M. Johnson wrote:
Agreed, sure, we have to treat the LHS of = as a local. But += is fundamentally different.
No it's not. It is fundamentally the same. Augmented assignment in Python *is* assignment, equivalent to x = x.__iadd__(other).
Or x = x.__add__(other) if no __iadd__ exists for the object. ~Ethan~