statelyai / xstate-python

XState for Python
MIT License
177 stars 18 forks source link

get_effective_target_states uses non-existent "transition" property #16

Closed dimsuz closed 3 years ago

dimsuz commented 3 years ago

One more oddity I've found while porting to kotlin:

get_effective_target_states function uses s.transition while StateNode does not have such property. It has only .transitions which is a list:

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

dimsuz commented 3 years ago

So far I'm porting "mindlessly" :wink: without giving it any thought (until I'll start to play with it/port tests over), so I don't feel confident enough to suggest a PR... Also no python setup as of yet. I'll just report as issues.

dimsuz commented 3 years ago

If you'll search for .transition in algorithm.py you'll find a few more usages of this non-existent property on state node, mostly commented out, but one other is not:

default_history_content[state.parent.id] = state.transition.content

davidkpiano commented 3 years ago

Made a few updates - see #20, this should be fixed.