statelyai/xstate-python

Function "add_descendent_states_to_enter" uses variable name which is not in scope

dimsuz opened this issue · 1 comments

When dealing with parallel state this bit of code passes variable s to add_descendent_states_to_enter (line 114), but it's not in scope here:

https://github.com/davidkpiano/xstate-python/blob/836b3a43a017831401cc3e44099d8f7090d60769/xstate/algorithm.py#L110-L119

Variable s is used in a list comprehension only. Unless I don't know something about python listcomp scoping.
Perhaps child should be passed here.

Not sure why it's not an error. Also I'm not sure how people manage to get anything sufficiently complex done in a language without proper type checking :)

Fixed in #20