O'Reilly logo
  • Sri Harsha V thinks this is interesting:

We actually encountered this concept in a prior exercise: if a collection object contains a reference to itself, it’s called a cyclic object. Python prints a [...] whenever it detects a cycle in the object, rather than getting stuck in an infinite loop (as it once did long ago):

>>> L = ['grail']                # Append reference to same object<...


Cover of Learning Python, 5th Edition


This part is something to be careful and mindful of, while coding.