how would you realize this
Code:
>>> base = [ "one", "two" ];
>>> list = [ base ];
>>> list.append(base);
>>> list.append(base);
>>> list.append(base);
>>> list
[['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two']]
>>>
if you will use just array, it should be array of pointers
Code:
>>> list[1:1] = [ "three" ];
>>> list
[['one', 'two'], 'three', ['one', 'two'], ['one', 'two'], ['one', 'two']]
>>>
then you have no uniform type for the data, it can be everything, it can be a number (you know how python coresponds to the types, in one list you can hold mixed type data)
and if you think that you can use a union for the diffrent types
Code:
>>> base = [ "one", 2, "three" ];
>>> list = [ base[:], base[:], base[:] ];
>>> list[1][1] *= 2;
>>> list[2][1] -= list[1][1];
>>> list
[['one', 2, 'three'], ['one', 4, 'three'], ['one', -2, 'three']]
>>> list[2][1:1] = [ [ "something", "else" ] ];
>>> list
[['one', 2, 'three'], ['one', 4, 'three'], ['one', ['something', 'else'], -2, 'three']]
>>>
what is the union base in this case ?
these are lists