Action callbacks mixed with decorator syntax and naming convention get called twice: I used the decorator method, but accidentally named the callbacks as per the naming convention method.
I would expect either silent handling of this, or raising an exception prohibiting this.
What I Did
from statemachine import State
from statemachine import StateMachine
class ExampleStateMachine(StateMachine):
Created = State(initial=True)
Inited = State()
initialize = Created.to(Inited)
@initialize.before
def before_initialize(self):
print("before init")
@initialize.on
def on_initialize(self):
print("on init")
def test_sm():
sm = ExampleStateMachine()
sm.initialize()
Description
Action callbacks mixed with decorator syntax and naming convention get called twice: I used the decorator method, but accidentally named the callbacks as per the naming convention method. I would expect either silent handling of this, or raising an exception prohibiting this.
What I Did
Prints: