(tree, branches=attrgetter("branches"))
return (node for node in postorder(tree, branches)
            if node.is_leaf)
Return an iterator over the leaf nodes in a tree structure.
Return an iterator over the leaf nodes in a tree structure.
Return an iterator over the leaf nodes in a tree structure .
def leaves(tree, branches=attrgetter("branches")):
    """
    Return an iterator over the leaf nodes in a tree structure.
    """
    return (node for node in postorder(tree, branches)
            if node.is_leaf)
def leaves ( tree , branches = attrgetter ( "branches" ) ) : return ( node for node in postorder ( tree , branches ) if node . is_leaf )