state

A discrete State.

class tinychain.state.Class(form=None)[source]

Bases: Object, Generic[T]

A TinyChain class (possibly a user-defined class).

class tinychain.state.Instance(form=None)[source]

Bases: Object

An instance of a user-defined Class.

copy()[source]
class tinychain.state.Object(form=None)[source]

Bases: State

A user-defined type

class tinychain.state.State(form=None)[source]

Bases: _Base

A TinyChain state, such as a Chain or Op or Value.

Do not subclass State directly. Use a more specific type instead.

cast(dtype)[source]

Attempt to cast this State into the given dtype.

hash()[source]

Return the SHA256 hash of this State as an Id.

is_none()[source]

Return Bool(true) if this State is Nil.

is_some()[source]

Return Bool(true) if this State is not Nil.

This is defined as self.is_none().logical_not().

class tinychain.state.StateRef(state, name)[source]

Bases: Ref

tinychain.state.hash_of(state)[source]

Return the hash of the given state.

This differs from Python’s built-in hash function in that it supports Map and Tuple.