When I do
>>> a = [1]*3
>>> a
[1,1,1]
>>> a[0] = a[0]+1
>>> a
[2,1,1]
which is perfectly fine, but when I do the same with sets iget the following
>>> a = [set()]*3
>>> a
[set([]), set([]), set([])]
>>> a[0].add(1)
>>> a
[set([1]), set([1]), set([1])]
Which is a very strange behaviour, any explanation for this?