Suppose I ran the program
x=[]
x.append(x)
print(x)
I get [[...]] as the output. But what does it mean? Is the list storing pointers and then pointing to itself? Or is it copying itself never quite completely? How is this list stored in memory?
Amendment: I'm trying to get my head around how python accomplishes this self reference. If I wanted to design a way of storing lists that allows for self reference, I would store a variable as a pair of values, the data type and value. If the data type is an int then the value represents the integer that is stored but if the data type is a list, I would say the stored value should be a pointer but pointing where? The beginning of the list like in C?