def IsAtom(self):
        """A tree is atomic if it has no subtrees."""
        try:
            self.childs.next()
        except StopIteration:
            return 1
        except AttributeError:
            return 1
        return 0
A tree is atomic if it has no subtrees.
recipes/Python/136529_Trees_and_more_trees/recipe-136529.py