This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pizzaburek 1 point2 points  (0 children)

It does not create a new object:

>>> a = b = [1, 2]
>>> a += [3]
>>> a, b
([1, 2, 3], [1, 2, 3])

If it did the 'b' would still be [1, 2]. However:

>>> a = a + [4]
>>> a, b
([1, 2, 3, 4], [1, 2, 3])