B
bartolome.sintes
Hi,
I thought that x += ... was the same than x = x + ..., but today I haverealized it is not true when operating with mutable objects.
In Python 3.3 or 2.7 IDLE (Windows) compare:
Is this behaviour explained in the Python documentation?
Thanking you in advance,
Bartolomé Sintes
I thought that x += ... was the same than x = x + ..., but today I haverealized it is not true when operating with mutable objects.
In Python 3.3 or 2.7 IDLE (Windows) compare:
[3, 1][3]a = [3]
b = a
a = a + [1]
b
anda = [3]
b = a
a += [1]
b
Is this behaviour explained in the Python documentation?
Thanking you in advance,
Bartolomé Sintes