Attributes#
| Attribute | Type | Description |
|---|---|---|
error | E_co | |
annotations | Annotations = field(default=_NO_ANNOTATIONS, hash=False, repr=False, kw_only=True) |
Functions#
__init__#
__init__(error, *, annotations=_NO_ANNOTATIONS) -> None| Parameter | Type | Description |
|---|---|---|
error | E_co | |
annotations | Annotations = _NO_ANNOTATIONS |
annotate#
annotate(annotations, *, overwrite=False) -> SelfA copy carrying annotations too. Keys it already has keep
their value unless overwrite; with nothing new, self.
| Parameter | Type | Description |
|---|---|---|
annotations | Context | |
overwrite | bool = False |
Returns Self
def annotate(self, annotations: Context, *, overwrite: bool = False) -> Self:
"""A copy carrying ``annotations`` too. Keys it already has keep
their value unless ``overwrite``; with nothing new, ``self``."""
merged = _merge_annotations(self.annotations, annotations.unsafe_map, overwrite)
return self if merged is None else replace(self, annotations=merged) # pyright: ignore[reportArgumentType, reportUnknownVariableType]