Skip to content

How to pass data in the case of inheriting from the Machine class? #607

Answered by aleneum
vba34520 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @vba34520,

pip install transitions==1.16.0

this looks incorrect. The current version of transitions is 0.9.0

In the second example you do not execute the callback set_environment. Compare

machine.add_transition('melt', 'solid', 'liquid', before='set_environment')

with

self.add_transition('melt', 'solid', 'liquid')

If you change this to

self.add_transition('melt', 'solid', 'liquid', before='set_environment')

you will get your desired output.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vba34520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #606 on March 21, 2023 08:23.