Detect self-referencing ellipses [...] and replace with a string

Viewed 27

When you create a self-referencing nest such as discussed in the question below, you end up with [...] representing infinite loops upon calling print. Aside from converting the nest into a string and replacing [...] with a string, is there another way to detect [...] so that I can replace it with another object (i.e. while recursing through the nested parent object)?

What do ellipsis [...] mean in a list?

0 Answers
Related