Home / Function/ _path_is_ancestor() — flask Function Reference

_path_is_ancestor() — flask Function Reference

Architecture documentation for the _path_is_ancestor() function in cli.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  81c57d5d_263b_1967_6c2b_cde10551054d["_path_is_ancestor()"]
  a96499c3_f8a9_e782_f156_1c1ee4a86c69["cli.py"]
  81c57d5d_263b_1967_6c2b_cde10551054d -->|defined in| a96499c3_f8a9_e782_f156_1c1ee4a86c69
  style 81c57d5d_263b_1967_6c2b_cde10551054d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/cli.py lines 691–695

def _path_is_ancestor(path: str, other: str) -> bool:
    """Take ``other`` and remove the length of ``path`` from it. Then join it
    to ``path``. If it is the original value, ``path`` is an ancestor of
    ``other``."""
    return os.path.join(path, other[len(path) :].lstrip(os.sep)) == other

Subdomains

Defined In

Frequently Asked Questions

What does _path_is_ancestor() do?
_path_is_ancestor() is a function in the flask codebase, defined in src/flask/cli.py.
Where is _path_is_ancestor() defined?
_path_is_ancestor() is defined in src/flask/cli.py at line 691.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free