A getter (see the module); tag is its kind.
Attributes#
| Attribute | Type | Description |
|---|---|---|
tag | Tag |
Functions#
__init__#
__init__() -> Noneapply#
apply(value, options) -> ParseResultThe output for value (MISSING when there is none).
| Parameter | Type | Description |
|---|---|---|
value | object | |
options | ParseOptions |
Returns ParseResult
@abstractmethod
def apply(self, value: object, options: ParseOptions) -> ParseResult:
"""The output for ``value`` (``MISSING`` when there is none)."""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)compose#
compose[T2, R2 = Never](other) -> Getter[T2, E_contra, R_co | R2]This getter, then other on its output (Effect's compose).
| Parameter | Type | Description |
|---|---|---|
other | Getter[T2, T_co, R2] |
Returns Getter[T2, E_contra, R_co | R2]
def compose[T2, R2 = Never](
self, other: Getter[T2, T_co, R2], /
) -> Getter[T2, E_contra, R_co | R2]:
"""This getter, then ``other`` on its output (Effect's ``compose``)."""
return cast("Getter[T2, E_contra, R_co | R2]", _compose(self, other))map#
map[T2](f) -> Getter[T2, E_contra, R_co]The output changed by f.
| Parameter | Type | Description |
|---|---|---|
f | Callable[[T_co], T2] |
Returns Getter[T2, E_contra, R_co]
def map[T2](self, f: Callable[[T_co], T2], /) -> Getter[T2, E_contra, R_co]:
"""The output changed by ``f``."""
return self.compose(Transform(f))