GitHub

API reference for Glob.

A compiled glob pattern; make builds one.

Attributes

AttributeTypeDescription
patternstr = pattern
dotbool = dot

Whether wildcards and ** match names that start with ..

Functions

__init__

__init__(pattern, *, dot=False) -> None
ParameterTypeDescription
patternstr
dotbool = False
def __init__(self, pattern: str, *, dot: bool = False) -> None:
    self.pattern = pattern
    self.dot = dot
    self._compiled = _compile.compile([pattern], dot)

match

match(path) -> bool

Whether path (/-separated) matches.

ParameterTypeDescription
pathstr

Returns bool

def match(self, path: str) -> bool:
    """Whether ``path`` (``/``-separated) matches."""
    return _match.match(self._compiled, path)

pipe

pipe[B](f) -> B
ParameterTypeDescription
fCallable[[Self], B]

Returns B

def pipe[B](self, f: Callable[[Self], B], /) -> B:
    return f(self)

to_json

to_json() -> dict[str, object]

Returns dict[str, object]

def to_json(self) -> dict[str, object]:
    return {"_id": "Glob", "pattern": self.pattern, "dot": self.dot}