Let's say I do:
>> a = [1, 2, 3]
>> b = a[:]
>> a[0] = 0
>> b
[1, 2, 3]
The statement b = a[:]
clearly created a list b
holding copies of the (potentially many) references that were also held by a
. But the =
operator only binds names and increase reference counts, so does the :
operator create copies of references in Python? If so, when it comes to accessing lists, is that unique to the :
operator? (e.g. indexing alone does not do that?)