Types

class statey.Type

A type encapsulates information about

render_type_string(renderer: Optional[statey.syms.types.TypeStringRenderer] = None)str

Render a nice human-readable representation of this type.

abstract with_meta(meta: Dict[str, Any]) → statey.syms.types.Type

Return a copy of this type with the given meta value

abstract with_nullable(nullable: bool) → statey.syms.types.Type

Return a copy of this type with the given nullable value

class statey.StringType(nullable: bool = False, meta: Dict[str, Any] = <factory>)
class statey.IntegerType(nullable: bool = False, meta: Dict[str, Any] = <factory>)
class statey.FloatType(nullable: bool = False, meta: Dict[str, Any] = <factory>)
class statey.BooleanType(nullable: bool = False, meta: Dict[str, Any] = <factory>)
statey.Struct

alias of statey.syms.types.StructType

class statey.StructType(fields: Sequence[statey.syms.types.Field], nullable: bool = False, meta: Dict[str, Any] = <factory>)

A struct contains an ordered sequence of named fields, any of which may or may not be null

with_fields(fields: Sequence[statey.syms.types.Field]) → statey.syms.types.Type

Return a copy of this type with the fields replaced

statey.Array

alias of statey.syms.types.ArrayType

class statey.ArrayType(element_type: statey.syms.types.Type, nullable: bool = False, meta: Dict[str, Any] = <factory>)

An array with some element type

with_element_type(element_type: statey.syms.types.Type) → statey.syms.types.Type

Return a copy of this type with the given element type

statey.Map

alias of statey.syms.types.MapType

class statey.MapType(key_type: statey.syms.types.Type, value_type: statey.syms.types.Type, nullable: bool = False, meta: Dict[str, Any] = <factory>)

An array with some element type

with_key_type(key_type: statey.syms.types.Type) → statey.syms.types.Type

Return a copy of this type with the given key type

with_value_type(value_type: statey.syms.types.Type) → statey.syms.types.Type

Return a copy of this type with the given key type

statey.EmptyType