class documentation

class MethodicalState(object): (source)

View In Hierarchy

A state for a MethodicalMachine.

Method upon Declare a state transition within the MethodicalMachine associated with this MethodicalState: upon the receipt of the `input`, enter the `state`, emitting each output in `outputs`.
Class Variable machine Undocumented
Class Variable method Undocumented
Class Variable serialized Undocumented
Method _name Undocumented
def upon(self, input: MethodicalInput, enter: MethodicalState | None = None, outputs: Iterable[MethodicalOutput] | None = None, collector: Callable[[Iterable[T]], object] = list): (source)

Declare a state transition within the MethodicalMachine associated with this MethodicalState: upon the receipt of the `input`, enter the `state`, emitting each output in `outputs`.

Parameters
input:MethodicalInputThe input triggering a state transition.
enter:MethodicalState | NoneThe resulting state.
outputs:Iterable[MethodicalOutput] | NoneThe outputs to be triggered as a result of the declared state transition.
collector:Callable[[Iterable[T]], object]The function to be used when collecting output return values.
Raises
TypeErrorif any of the `outputs` signatures do not match the `inputs` signature.
ValueErrorif the state transition from `self` via `input` has already been defined.

Undocumented

method: Callable[..., Any] = (source)

Undocumented

serialized: bool = (source)

Undocumented

def _name(self) -> str: (source)

Undocumented