Issue 1084906: list initialization bug (original) (raw)
Python 2.3.4 running on Linux Redhat 9.1
The following initialization produces an unwanted (I think) side effect,
a,b=2*[[0]*2]
It seems that both a and b point to the same address For example, a[1]=1 gives me a=[0,1] but produces, as a side effect, b=[0,1] !!!!
However, the following works a,b = [[0]*2,[0]*2]