GitHub

ClassShape

API reference for ClassShape.

What a Class node needs from a schema class.

Attributes

AttributeTypeDescription
clstype
fieldsObjects

The decoding struct of the fields (a tagged class's tag too).

encodedAST

The struct's encoded side.

checksChecks | None

The class's own checks, run on each instance it makes.

Functions

construct

construct(values) -> object

An instance from parsed values, not checked again.

ParameterTypeDescription
valuesdict[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).

ParameterTypeDescription
instanceobject

Returns dict[object, object]

def values_of(self, instance: object) -> dict[object, object]:
    """The struct value of ``instance`` (a tagged class's tag too)."""
    ...