def links(self, skipself=False): if not skipself: yield self for child in self._children: for link in child.links(): yield link