On Thu, Nov 20, 2014 at 10:54 PM, Gill Shen <gillar...@gmail.com> wrote:
> How is this behavior implemented under the hood? And why is this allowed at 
> all? Is it just a curiosity or can you do something useful with it?

Reference cycles are common in Python and other OO languages. For
example, adding a widget to a window; the window contains references
to its child widgets, and it's probably useful for the widgets to know
what their parents are, so they would hold references back.

A list containing itself is similarly a reference cycle. I don't know
off-hand of any use for this specific case, but it's just a slightly
tighter cycle than normal.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to