def isLeaf(self):
        """ Return whether I am a leaf component or not """

        # I am a leaf if I have no children
        return not self._children
 Return whether I am a leaf component or not 
recipes/Python/498249_Composite_designpattern_using/recipe-498249.py