J
Jiri Barton
Hi everyone,
I have a problem with initialization.
Why is this? Why does not this behave like the below:
And, just to add to my confusion:
Thanks in advance for the explanation.
jbar
BTW, if it matters...
Python 2.4.1 (#2, Mar 30 2005, 20:41:35)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
I have a problem with initialization.
[1]a, b = [[]]*2
a.append(1)
b
Why is this? Why does not this behave like the below:
[]a, b = [[], []]
a.append(1)
b
And, just to add to my confusion:
True[[]]*2 [[], []]
[[], []] == [[]]*2
Thanks in advance for the explanation.
jbar
BTW, if it matters...
Python 2.4.1 (#2, Mar 30 2005, 20:41:35)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2