archimedes.tree.allΒΆ
- archimedes.tree.all(tree: Tree, is_leaf: Callable[[Any], bool] | None = None) boolΒΆ
Check if all leaves in the tree evaluate to True.
- Parameters:
tree (Tree) β A tree to check.
is_leaf (callable, optional) β A function that takes a tree node as input and returns a boolean indicating whether it should be considered a leaf.
- Returns:
result β True if all leaves in the tree evaluate to True, False otherwise.
- Return type:
bool
See also
tree_mapApply a function to each leaf in a tree
tree_leavesExtract just the leaf values from a tree