-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
In Python, if a constructor is declared, it has to explicitly call the base class constructor, otherwise it's never called.
Currently the generated class constructor looks something like this:
# State machine constructor. Must be called before start or dispatch event functions. Not thread safe.
def __init__(self):
# Used internally by state machine. Feel free to inspect, but don't modify.
self.stateId = None
It could be rewritten like this, so that all potential arguments get passed to the base class constructor:
# State machine constructor. Must be called before start or dispatch event functions. Not thread safe.
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Used internally by state machine. Feel free to inspect, but don't modify.
self.stateId = None
Here is my attempt to implement it that way:
main...alexis-boisserand:StateSmith:main
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done