-
-
Notifications
You must be signed in to change notification settings - Fork 113
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn 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
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: fgmacedo/python-statemachine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 4 commits
- 33 files changed
- 1 contributor
Commits on Aug 1, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 0dad86c - Browse repository at this point
Copy the full SHA 0dad86cView commit details -
fix: Python 3.10-compatible add_note pollution test; drop em dashes f…
…rom 3.2.1 notes (#642)
Configuration menu - View commit details
-
Copy full SHA for 78e2b4c - Browse repository at this point
Copy the full SHA 78e2b4cView commit details
Commits on Sep 13, 2026
-
fix: support event declarations inside State.Compound bodies (#645)
* fix: support event declarations inside State.Compound bodies A nested state class body only understood the assignment form of an event declaration. The `Event` class and the `@<source>.to(<target>)` decorator both fell through to the generic callable branch, so the name was bound to a detached object and the transition it wrapped stayed eventless, firing as soon as its source state became active. Handle both forms in the nested class body scanner, which is extracted from `NestedStateFactory.__new__` into `_collect_nested_members`. Closes #643 Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * refactor: read statechart class bodies through one shared reader The two kinds of statechart class body, a StateChart subclass and a nested State.Compound / State.Parallel, accept the same declaration forms, but each had its own copy of the recognition table. That is how #643 happened: the nested copy never learned about `Event`, so an event declared there silently became an eventless transition. Recognition now lives once in `class_body.read`, which dispatches to a reader supplying only what each side does with a form. The reader interface is a Protocol, so a form added to one side and forgotten on the other is a type error rather than a silent gap. Drop the `error_` prefix expansion the previous commit gave to nested decorated events: it is not what the top-level path does, and the two must agree. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * docs: drop the versionchanged note for the compound Event fix The docs describe the current behavior. The previous behavior was a bug, not a documented contract, and the release notes already carry the history. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * refactor: declare nested events inline instead of through a shared reader The reader added a module, a seven-method Protocol under TYPE_CHECKING and two implementations, to share class body recognition between the statechart metaclass and NestedStateFactory. The two consumers need different amounts of it, which showed up as an aliased on_history on one side and an empty on_other on the other, and all three defects found in review lived in the nested implementation. Declare the Event and decorator forms with two branches in the loop that was already there. The event reaches the machine through the path that already exists: add_state walks the tree and collects state.transitions.unique_events. Nothing is placed in the callbacks dict, so the expanded id of an error_ prefix no longer overwrites the class attribute that add_event had bound correctly. Two differences from the top level remain, both because a nested body is evaluated before the owning class exists: an explicit id that differs from the attribute name does not also bind the attribute name, and a transition-less Event is dropped. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * fix: keep delay and internal when declaring an explicit Event Event(dark.to(lit), delay=50) rebuilt the event without its delay, so BeaconsOfGondor.light.delay was 0 and the event fired immediately instead of being queued. internal was dropped the same way. test_delayed_event_on_event_definition built its own BoundEvent(delay=50) instead of triggering the declared one, so it never exercised the bug. internal is preserved on the declaration but still has no effect at trigger time: Event.__get__ does not pass it to BoundEvent and send() does not read it. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * docs: link the nested Event limitations to their issues The notes stated what does not work without pointing anywhere. #656 covers the missing attribute binding in a nested body, #655 the internal flag that is preserved on the declaration but ignored at trigger time. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> * docs: drop the compound Event section and the issue links Declaring an Event inside a nested body was always expected to work, so an example for it repeats what the section above already shows. Open limitations are tracked on GitHub, not in the docs. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com> --------- Signed-off-by: Fernando Macedo <fgmacedo@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 45d6ab1 - Browse repository at this point
Copy the full SHA 45d6ab1View commit details
Commits on Sep 14, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 525bcdd - Browse repository at this point
Copy the full SHA 525bcddView commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...develop