Skip to content

Commit 00af5b0

Browse files
committed
docs: update source doctests to use StateChart as primary API
1 parent 2397d84 commit 00af5b0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

statemachine/states.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class States:
1212
"""
1313
A class representing a collection of :ref:`State` objects.
1414
15-
Helps creating :ref:`StateMachine`'s :ref:`state` definitions from other
15+
Helps creating :ref:`StateChart`'s :ref:`state` definitions from other
1616
sources, like an ``Enum`` class, using :meth:`States.from_enum`.
1717
1818
>>> states_def = [('open', {'initial': True}), ('closed', {'final': True})]
1919
20-
>>> from statemachine import StateMachine
21-
>>> class SM(StateMachine):
20+
>>> from statemachine import StateChart
21+
>>> class SM(StateChart):
2222
...
2323
... states = States({
2424
... name: State(**params) for name, params in states_def
@@ -30,8 +30,8 @@ class States:
3030
3131
>>> sm = SM()
3232
>>> sm.send("close")
33-
>>> sm.current_state.id
34-
'closed'
33+
>>> sm.closed.is_active
34+
True
3535
3636
"""
3737

0 commit comments

Comments
 (0)