Guess you have following code:
x = [1, 2, 3]
x.append(x)
print(x)
The output:
Did you know/expect that?
It's infinite, because it refers on itself.
You can do this:
def infinite_loop():
x = [1, 2, 3]
x.append(x)
while True:
x = x[-1]
Cool not seen that before.
pprint gives some more info.
λ ptpython
>>> from pprint import pprint
>>> x = [1, 2, 3]
>>> x.append(x)
>>> x
[1, 2, 3, [...]]
>>> pprint(x)
[1, 2, 3, <Recursion on list with id=88766544>]
>>> x[-1]
[1, 2, 3, [...]]
>>> x == x[-1]
True