Crappy function that finds a single loop in the tree

def find_loops(self, _path=None):
        """Crappy function that finds a single loop in the tree"""

        if _path is None:
            _path = []

        if self in _path:
            return _path + [self]
        elif self._children == []:
            return None
        else:
            for child in self._children:
                return child.find_loops(_path + [self])