Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also orlearn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also.Learn more about diff comparisons here.
base repository:fgmacedo/python-statemachine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base:main
Choose a base ref
Loading
...
head repository:fgmacedo/python-statemachine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare:develop
Choose a head ref
Loading
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8commits
  • 17files changed
  • 6contributors

Commits on Dec 3, 2024

  1. Merge tag 'v2.5.0' into develop

    *November 5, 2024*This release introduces powerful new features for the `StateMachine`library: {ref}`Condition expressions` and explicit definition of{ref}`Events`. These updates make it easier to define complex transitionconditions and enhance performance, especially in workflows with nestedor recursive event structures.StateMachine 2.4.0 supports Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, and3.13.This release introduces support for conditionals with Boolean algebra.You can now use expressions like `or`, `and`, and `not` directly withintransition conditions, simplifying the definition of complex statetransitions. This allows for more flexible and readable condition setupsin your state machine configurations.Example (with a spoiler of the next highlight):```py>>> from statemachine import StateMachine, State, Event>>> class AnyConditionSM(StateMachine):...     start = State(initial=True)...     end = State(final=True)......     submit = Event(...         start.to(end, cond="used_money or used_credit"),...         name="finish order",...     )......     used_money: bool = False...     used_credit: bool = False>>> sm = AnyConditionSM()>>> sm.submit()Traceback (most recent call last):TransitionNotAllowed: Can't finish order when in Start.>>> sm.used_credit = True>>> sm.submit()>>> sm.current_state.id'end'``````{seealso}See {ref}`Condition expressions` for more details or take a look at the{ref}`sphx_glr_auto_examples_lor_machine.py` example.```Now you can explicit declare {ref}`Events` using the {ref}`event` class.This allows custom naming, translations, and also helps your IDE to knowthat events are callable.```py>>> from statemachine import StateMachine, State, Event>>> class StartMachine(StateMachine):...     created = State(initial=True)...     started = State(final=True)......     start = Event(created.to(started), name="Launch the machine")...>>> [e.id for e in StartMachine.events]['start']>>> [e.name for e in StartMachine.events]['Launch the machine']>>> StartMachine.start.name'Launch the machine'``````{seealso}See {ref}`Events` for more details.```We removed a note from the docs saying to avoid recursion loops. Sincethe {ref}`StateMachine 2.0.0` release we've turned the RTC model enabledby default, allowing nested events to occour as all events are put on aninternal queue before being executed.```{seealso}See {ref}`sphx_glr_auto_examples_recursive_event_machine.py` for anexample of an infinite loop state machine declaration using `after`action callback to call the same event over and over again.```- Fixes  [#484](#484)issue where nested events inside loops could leak memory by incorrectly  referencing previous `event_data` when queuing the next event. Thisfix improves performance and stability in event-heavy workflows.
    @fgmacedo
    fgmacedo committedDec 3, 2024
    Configuration menu
    Copy the full SHA
    68ba609View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4449a9cView commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2025

  1. docs: mention pydot resolution settings (#514)

    * docs: mention pydot resolution settings---------Co-authored-by: Albert Latham <albertlatham@gladiatortechnologies.com>
    @comalice
    comalice andAlbert Latham authoredJan 14, 2025
    Configuration menu
    Copy the full SHA
    9954890View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2025

  1. Configuration menu
    Copy the full SHA
    bdb4fbdView commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef351d5View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2025

  1. fix: typos (#522)

    @alexei
    alexei authoredApr 14, 2025
    Configuration menu
    Copy the full SHA
    b0367f0View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2025

  1. Configuration menu
    Copy the full SHA
    8054786View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2025

  1. Fix: Sanitise project path on windows for doc build (#527)

    * Sanitise project path on windows for doc build* MachineScraper now uses regex escape function for robustness
    @OliverDavey
    OliverDavey authoredJul 1, 2025
    Configuration menu
    Copy the full SHA
    9a089edView commit details
    Browse the repository at this point in the history
Loading

[8]ページ先頭

©2009-2025 Movatter.jp