build_ancestor_paths
functionsignature
build_ancestor_paths(path): str[]Build a dotted path's ancestor chain, root-first.
Parameters
| Name | Type | Description |
|---|---|---|
path | str | A dotted path; a leading dot is trimmed. |
Returns
str[] — Each prefix of `path`, shortest first. `[]` for the empty path.
Example
example
>>> build_ancestor_paths("x.y.z")
['x', 'x.y', 'x.y.z']