Circular Reference With Python Lists
Can someone explain this? >>> x=x[0]=[0] >>> x [[...]] >>> x is x[0] True >>> x[0][0][0][0][0][0][0] [[...]] >>> x in x True what is [
Solution 1:
That's just Python telling you that you have a circular reference; it's smart enough not to enter an infinite loop trying to print it out.
Solution 2:
It's output by the method responsible for generating the representation of the structure. It represents a recursive structure, elided since it can be nested infinitely.
Post a Comment for "Circular Reference With Python Lists"