WS-740: remove last traces of TransitionIF; fix types
1 unresolved thread
1 unresolved thread
-
removed last traces of TransitionIF -
fixed type hints
Edited by Janet Goldstein
Merge request reports
Activity
34 36 matching pattern, we perform that transition to another state. 35 37 """ 36 38 37 def __init__(self, transitions: list["TransitionIF"]): 39 def __init__(self, transitions: List[Transition]): 38 40 # We have a bit of a chicken-and-egg problem here, in that the State needs Transitions to be initialized but 39 41 # the Transition needs States to be initialized. Going from prototype to production here will mean breaking 40 42 # this cycle, possibly by introducing a builder of some kind, but for now we can just pretend that they are 41 43 # built successfully somehow. 42 44 self.transitions = transitions 43 45 44 def on_event(self, event: dict) -> Optional["State"]: 46 def on_event(self, event: Dict) -> Optional[State]: (did somebody go in and change it already? now there's no
Dict[str, str]
in statemachine)Edited by Janet GoldsteinThere isn't a meaningful distinction between
dict
andDict
really, and in neither case are you required to specify the types. If your dictionary always has keys of a certain type and values of another certain type, you can specifyDict[KeyType, ValueType]
but it isn't obligatory. The only reason for the distinction betweendict
andDict
is that before Python 3.9,dict[KeyType, ValueType]
is an error butDict[KeyType, ValueType]
works. After 3.9, both work the same way andDict
isn't really needed. Same withlist
andList
.
enabled an automatic merge when the pipeline for fb862df7 succeeds
Please register or sign in to reply