def all_leaf_positions(parented_tree):
    """Return tree positions of all leaves of a ParentedTree,
    even if the input is only a subtree of that ParentedTree.
    """
    return parented_tree.root().treepositions('leaves')