What a Class node needs from a schema class.
Attributes#
| Attribute | Type | Description |
|---|---|---|
cls | type | |
fields | Objects | The decoding struct of the fields (a tagged class's tag too). |
encoded | AST | The struct's encoded side. |
checks | Checks | None | The class's own checks, run on each instance it makes. |
Functions#
construct#
construct(values) -> objectAn instance from parsed values, not checked again.
| Parameter | Type | Description |
|---|---|---|
values | dict[object, object] |
Returns object
def construct(self, values: dict[object, object]) -> object:
"""An instance from parsed values, not checked again."""
...values_of#
values_of(instance) -> dict[object, object]The struct value of instance (a tagged class's tag too).
| Parameter | Type | Description |
|---|---|---|
instance | object |
Returns dict[object, object]
def values_of(self, instance: object) -> dict[object, object]:
"""The struct value of ``instance`` (a tagged class's tag too)."""
...