How to pass data between states / what should the signature of every state be?
sietse opened this issue · comments
How to pass data between states / what should the signature of every state be?
Options:
mystate(self) -> next_state
: pass data by mutating self; for CSMs (child state machines), parent setsnsm.parent = self
.mystate(self, obj) -> next_state
:obj
is the object representing the process/entity/actor: for top-level FSMsobj
isself
, but for CSMsobj
isparent
mystate(self, data) -> next_state
: usuallyobj
isself
, but for CSMsobj
isparent
mystate(self, arg1, arg2, kwarg3=...) -> next_state, next_state_args, next_state_kwargs