jtushman / state_machine

Python State Machine for humans
MIT License
400 stars 31 forks source link

How to set the initial state #30

Open zhusichuang opened 6 years ago

zhusichuang commented 6 years ago

I want to set the initial state dynamically, like this: def __init__(self, state): self.current_state=state but this will give the error "cant't set the attribute"

chengtian5huang commented 6 years ago

default

来自Sakis Kasampalis 所著的 Mastering Python Design Patterns,该书由夏永峰翻译为简体中文。 screenshot form Mastering Python Design Patterns by Sakis Kasampalis, and its translated to simplified-chinese by Yongfeng Xia.