@@ -55,9 +55,13 @@ class StateChart(Generic[TModel], metaclass=StateMachineMetaclass):
5555 start_value: An optional start state value if there's no current state assigned
5656 on the :ref:`domain models`. Default: ``None``.
5757
58- listeners: An optional list of objects that provies attributes to be used as callbacks.
58+ listeners: An optional list of objects that provides attributes to be used as callbacks.
5959 See :ref:`listeners` for more details.
6060
61+ **kwargs: Additional keyword arguments available for dependency injection into
62+ callbacks. These are passed to class listener ``setup()`` methods and to the
63+ initial activation callbacks (e.g. ``on_enter_<state>``).
64+
6165 """
6266
6367 TransitionNotAllowed = TransitionNotAllowed
@@ -145,9 +149,13 @@ def __init__(
145149 ** kwargs : Any ,
146150 ):
147151 self .model : TModel = model if model is not None else Model () # type: ignore[assignment]
148- self .history_values : Dict [
149- str , List [State ]
150- ] = {} # Mapping of compound states to last active state(s).
152+ """The external model object that holds domain state, or an internal
153+ :class:`Model` instance when none is provided. See :ref:`domain models`."""
154+
155+ self .history_values : Dict [str , List [State ]] = {}
156+ """Mapping from compound state IDs to the list of states that were active
157+ the last time that compound state was exited. Used by history pseudo-states
158+ to restore previous configurations."""
151159 self .state_field = state_field
152160 self .start_configuration_values = (
153161 [start_value ] if start_value is not None else list (self .start_configuration_values )
@@ -416,6 +424,7 @@ def current_state(self, value):
416424
417425 @property
418426 def events (self ) -> "List[Event]" :
427+ """List of all :ref:`Event` instances declared on this state machine."""
419428 return [getattr (self , event ) for event in self .__class__ ._events ]
420429
421430 @property
0 commit comments