Python-statemachine

Latest version: v2.4.0

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

Scan your dependencies

Page 1 of 2

2.4.0

- Fixes [484](https://github.com/fgmacedo/python-statemachine/issues/484) issue where nested events inside loops could leak memory by incorrectly
referencing previous `event_data` when queuing the next event. This fix improves performance and stability in event-heavy workflows.

2.3.1

This release introduces native coroutine support using asyncio, enabling seamless integration with asynchronous code.

Now you can send and await for events, and also write async Actions, Conditions and Validators.



py
>>> class AsyncStateMachine(StateMachine):
... initial = State('Initial', initial=True)
... final = State('Final', final=True)
...
... advance = initial.to(final)

>>> async def run_sm():
... sm = AsyncStateMachine()
... await sm.advance()
... print(sm.current_state)

>>> asyncio.run(run_sm())
Final

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.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.