A compiled glob pattern; make builds one.
Attributes#
| Attribute | Type | Description |
|---|---|---|
pattern | str = pattern | |
dot | bool = dot | Whether wildcards and |
Functions#
__init__#
__init__(pattern, *, dot=False) -> None| Parameter | Type | Description |
|---|---|---|
pattern | str | |
dot | bool = 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) -> boolWhether path (/-separated) matches.
| Parameter | Type | Description |
|---|---|---|
path | str |
Returns bool
def match(self, path: str) -> bool:
"""Whether ``path`` (``/``-separated) matches."""
return _match.match(self._compiled, path)pipe#
pipe[B](f) -> B| Parameter | Type | Description |
|---|---|---|
f | Callable[[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}