June 1, 2011
12:29 p.m.
On Wed, Jun 01, 2011 at 07:48:19AM +0200, Georg Brandl wrote:
Because x += y is equivalent to
x = x.__iadd__(y)
and therefore an assignment is going on here. Therefore, it's only logical to treat it as such when determining scopes.
Georg
And it's like this so that immutable classes work correctly, as far as I can see. So one way to answer the original idea is: because of immutable classes, += does not have the same semantics as .append() Andrew