statelyai / xstate-python

XState for Python
MIT License
177 stars 18 forks source link

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

Closed dimsuz closed 3 years ago

dimsuz commented 3 years ago

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 :)

davidkpiano commented 3 years ago

Fixed in #20