I just got some weird output of a python script:
[[(7, 6), (6, 4), (7, 2)], [...], [...], [...], [(7, 6), (8, 4), (7, 2)], [...], [...], [...], [...], [...], [...], [...]]
The output should be a list of lists of tuples. But I have no idea why [...] appears.
What does [...] mean?
I don't think its an empty list, as an empty list were []. Are these perhaps duplicates?
It is a recursive reference. Your list contains itself, or at least there is some kind of cycle.
Example:
x = []
x.insert(0, x)
# now the repr(x) is '[[...]]'.
The built-in repr
for lists detects this situation and does not attempt to recurse on the sub-list (as it normally would), because that would lead to infinite recursion.
Note that ...
doesn't necessarily tell you which list is referred to:
y, z = [], []
x = [y, z]
y.insert(0, z)
z.insert(0, y)
# looks the same as it would if y contained y and z contained z.
so repr
is not really a complete serialization format for lists.
As to why you're getting them: we're not psychic, and can't fix the problem with your code unless we see the code.
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