J
jonkje
Hello I found this very strange; is it a bug, is it a "feature", am I
being naughty or what?
Why on earth does foo and baz behave differently??
Btw.:
Python 2.4.1 (#1, Apr 10 2005, 22:30:36)
[GCC 3.3.5] on linux2
--- Jon Øyvind
being naughty or what?
[[1, 0], [1, 0]]foo = [[0, 0], [0, 0]]
baz = [ [0]*2 ] * 2
foo [[0, 0], [0, 0]]
baz [[0, 0], [0, 0]]
foo[0][0]=1
baz[0][0]=1
foo [[1, 0], [0, 0]]
baz
Why on earth does foo and baz behave differently??
Btw.:
Python 2.4.1 (#1, Apr 10 2005, 22:30:36)
[GCC 3.3.5] on linux2
--- Jon Øyvind