Should I worry about circular references in Python?

前端 未结 6 561

Suppose I have code that maintains a parent/children structure. In such a structure I get circular references, where a child points to a parent and a parent points to a chil

6条回答
  •  一个人的身影
    2020-12-02 19:14

    Circular references are a normal thing to do, so I don't see a reason to be worried about them. Many tree algorithms require that each node have links to its children and its parent. They're also required to implement something like a doubly linked list.

提交回复
热议问题