Row#
- class tierkreis.core.types.Row(content: dict[str, ~tierkreis.core.types.TierkreisType] = <factory>, rest: str | None = None)[source]#
Bases:
TierkreisType
A row of fields, each with a label and a type. Used to define inputs and outputs of a function or the fields of a Struct.
Methods
For composite types (e.g. Struct, Vec, Map), list the child types that define it concretely.
contained_vartypes
Attempts to convert a protobuf type to a TierkreisType subclass.
from_proto_rowtype
Create a TierkreisType from a corresponding Python type.
Create a TierkreisType from a Union type.
Register an alternative type that can be used to convert to/from TierkreisType.
Converts a tierkreis type to its protobuf representation.
to_tksl
Attributes
rest
content
- children() list[TierkreisType] [source]#
For composite types (e.g. Struct, Vec, Map), list the child types that define it concretely.
- classmethod from_proto(type_: Type) Row [source]#
Attempts to convert a protobuf type to a TierkreisType subclass.
- classmethod from_python(type_: Type, visited_types: dict[Type, TierkreisType] | None = None) Row [source]#
Create a TierkreisType from a corresponding Python type.
- Parameters:
type – The Python type.
visited_types – An optional map from previously visited Python types
TierkreisType (to)
recursively. (used when converting)
- Raises:
IncompatibleUnionType – Failure to convert a Union.
IncompatiblePyType – Python type cannot be converted to a Tierkreis type.
- Returns:
TierkreisType
- classmethod from_python_union(type_: UnionType, visited_types: dict[Type, TierkreisType] | None = None) TierkreisType #
Create a TierkreisType from a Union type.
- classmethod register_alternative(type_: Type, alternative: Type[SerializeAs])#
Register an alternative type that can be used to convert to/from TierkreisType.