Python-statemachine

Latest version: v2.2.0

Safety actively analyzes 626513 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.2.0

- Fixes [424](https://github.com/fgmacedo/python-statemachine/issues/424) allowing `deepcopy` of state machines.
- **Dispatch Mechanism**: Resolved issues in the dispatch mechanism in `statemachine/dispatcher.py` that affected the reliability
of event handling across different states. This fix ensures consistent behavior when events are dispatched in complex state
machine configurations.

2.1.2

- Fixes [406](https://github.com/fgmacedo/python-statemachine/issues/406) action callback being
called twice when mixing decorator syntax combined with the naming convention.

2.1.1

- Fixes [391](https://github.com/fgmacedo/python-statemachine/issues/391) adding support to
[pytest-mock](https://pytest-mock.readthedocs.io/en/latest/index.html) `spy` method.
- Improved factory type hints [399](https://github.com/fgmacedo/python-statemachine/pull/399).

2.1.0

- Fixes [369](https://github.com/fgmacedo/python-statemachine/issues/369) adding support to wrap
methods used as [Actions](https://python-statemachine.readthedocs.io/en/2.1.0/actions.html#actions) decorated with `functools.partial`.
- Fixes [384](https://github.com/fgmacedo/python-statemachine/issues/384) so multiple observers can watch the same callback.

2.0

`State.identification` removed in favor of `State.id`

py
from tests.examples.traffic_light_machine import TrafficLightMachine

sm = TrafficLightMachine()
assert sm.current_state.identification == "green"



Should become:

py
>>> from tests.examples.traffic_light_machine import TrafficLightMachine

>>> sm = TrafficLightMachine()
>>> assert sm.current_state.id == "green"

2.0.0

This version is the first to take advantage of the Python3 improvements and is a huge internal refactoring removing the deprecated features on 1.*. We hope that you enjoy it.

These release notes cover the what's new in 2.0, as well as some backward incompatible changes you'll
want to be aware of when upgrading from StateMachine `1.*`.


Python compatibility in 2.0

StateMachine 2.0 supports Python 3.7, 3.8, 3.9, 3.10, and 3.11.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.