Skip to content

Type Aliases

Shared type aliases for the parse and query APIs.

Kept free of runtime dependencies on the node tree: ConfigNode is imported only for type checking and referenced via a forward reference, so node.py can import these aliases without creating an import cycle.

ConfigSource module-attribute

ConfigSource: TypeAlias = (
    str | Path | IO[str] | IO[bytes] | Iterable[str]
)

Patterns module-attribute

Patterns: TypeAlias = (
    str | re.Pattern[str] | Iterable[str | re.Pattern[str]]
)

Predicate module-attribute

Predicate: TypeAlias = Callable[['ConfigNode'], bool]