Hi,

Here is what I'm doing in python 2.4.1 :

>>> aOfa=[[[]]*3]*4
>>> aOfa
[[[], [], []], [[], [], []], [[], [], []], [[], [], []]]
>>> aOfa[3][2].append(1)
>>> aOfa
[[[1], [1], [1]], [[1], [1], [1]], [[1], [1], [1]], [[1], [1], [1]]]

Ok, so there is something I didn't understand about python's arrays.

The result I was expecting was :

[[[], [], []], [[], [], []], [[], [], []], [[], [], [1]]]

Somebody understand what's going on here?

Thank

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to