Instead of a list with some objects in it, I get [...]
whenever I run my code. I'd like to know what it means, in order to debug my code.
That most probably is a reference to the object itself. Example:
In [1]: l = [0, 1]
In [2]: l.append(l)
In [3]: l
Out[3]: [0, 1, [...]]
In the above, the list l
contains a reference to itself. This means, you can endlessly print elements within it (imagine [0, 1, [0, 1, [0, 1, [...]]]]
and so on) which is restricted using the ...
IMO, you are incorrectly appending values somewhere in your code which is causing this.
A more succinct example:
In [1]: l = []
In [2]: l.append(l)
In [3]: l
Out[3]: [[...]]
>>> data = []
>>> data.append([1,3,4])
>>> data
[[1, 3, 4]]
>>> data.append([1,3,data])
>>> data
[[1, 3, 4], [1, 3, [...]]]
>>> data[0]
[1, 3, 4]
>>> data[1]
[1, 3, [[1, 3, 4], [...]]]
>>> data.append([1,2,data])
>>> data
[[1, 3, 4], [1, 3, [...]], [1, 2, [...]]]
>>> data[2]
[1, 2, [[1, 3, 4], [1, 3, [...]], [...]]]
Then it just gets weird
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With