Event(a.to(b), internal=True) is meant to put the event on the internal queue, which is what
Event.put reads (self._sm._put_nonblocking(trigger_data, internal=self.internal)). But nothing
ever carries the declared value to the object that put is called on:
Event.__get__ builds BoundEvent(id=..., name=..., delay=..., _sm=instance) and omits
internal, so sm.go() always uses the default False.
StateChart.send reads know_event.delay from the class attribute but takes internal only
as its own parameter, so sm.send("go") ignores the declaration too.
Measured after #645, which fixed the declaration side:
class Internal(StateChart):
a = State(initial=True)
b = State(final=True)
go = Event(a.to(b), internal=True)
[e.internal for e in Internal.events] # [True] -- declaration is preserved
Internal().go.internal # False -- the bound event is not
delay works end to end through both paths; internal is the one left inert. #645 fixed the declaration side (see #647, closed) and deliberately stopped there, because the
remaining fix lives in event.py and statemachine.py, outside what that PR touched.
When fixing: docs/releases/3.2.2.md currently states that internal is preserved on the
declaration; update that once it actually takes effect, check whether docs/processing_model.md
should show the declarative form next to raise_(), and add an entry to the open release notes.
Event(a.to(b), internal=True)is meant to put the event on the internal queue, which is whatEvent.putreads (self._sm._put_nonblocking(trigger_data, internal=self.internal)). But nothingever carries the declared value to the object that
putis called on:Event.__get__buildsBoundEvent(id=..., name=..., delay=..., _sm=instance)and omitsinternal, sosm.go()always uses the defaultFalse.StateChart.sendreadsknow_event.delayfrom the class attribute but takesinternalonlyas its own parameter, so
sm.send("go")ignores the declaration too.Measured after #645, which fixed the declaration side:
delayworks end to end through both paths;internalis the one left inert. #645 fixed the declaration side (see #647, closed) and deliberately stopped there, because theremaining fix lives in
event.pyandstatemachine.py, outside what that PR touched.When fixing:
docs/releases/3.2.2.mdcurrently states thatinternalis preserved on thedeclaration; update that once it actually takes effect, check whether
docs/processing_model.mdshould show the declarative form next to
raise_(), and add an entry to the open release notes.