Closed chrisjbremner closed 4 years ago
@aleneum I also found that the diagramming extensions did not work when using Enum
s for states (because it sometimes referred to each state by the Enum's name, and other times by just the Enum itself), so I attempted to fix that as well in my most recent commit.
Looks like my second commit broke some tests, I will fix that when I get a chance.
Closing, as this was fixed in https://github.com/pytransitions/transitions/pull/357
Enum
allows you to subclass it with additional mixins to create customEnum
s that act in a similar fashion to what you are mixing in. For example, you can create anIntEnum
which allows the enum to be used like anint
. Similarly, you can make aStrEnum
to do string comparisons.Using a
StrEnum
almost works with the existing code base, but there's one small if statement that incorrectly catchesStrEnum
s but not regularEnum
s, which I fix in this PR. I also included a test that would fail without this code change, but succeeds after.