(self, parent: Self | None)
| 127 | return any(n is self for n in node.parents) |
| 128 | |
| 129 | def _detach(self, parent: Self | None) -> None: |
| 130 | if parent is not None: |
| 131 | self._pre_detach(parent) |
| 132 | parents_children = parent.children |
| 133 | parent._children = { |
| 134 | name: child |
| 135 | for name, child in parents_children.items() |
| 136 | if child is not self |
| 137 | } |
| 138 | self._parent = None |
| 139 | self._post_detach(parent) |
| 140 | |
| 141 | def _attach(self, parent: Self | None, child_name: str | None = None) -> None: |
| 142 | if parent is not None: |
no test coverage detected