I happened on this peculiar behaviour accidentally:
>>> a = []
>>> a[:] = [\'potato\', a]
>>> print a
[\'potato\', [...]]
>>
The ...
is only displayed when an item contains itself -- that is, the same object. list(a)
makes a copy of the list, so the inner a
isn't the same object. It only shows the ...
when it gets to "a inside a", not "a inside list(a)
".
list()
makes a shallow copy. The outer list is no longer the same object as the list it contains. It is printed as you would expect.