pytransitions/transitions

In a class ABCD inside the init method I have variable state consisting of OrderedDict containing list of dictionaries. Basically the state is of module 'transitions' which are imported from class 'machine' and inside state I have orderedDict consisting of list of dictionaries.

msdian-hub opened this issue · 1 comments

State as variable in init method containing OrderedDict consiting of list of dictionaries not working as intended.

class ABCD(Machine)
def init(self,args):
self.a=opts['a']
self.a=opts['b']
self.states=orderedDict([{'name':'start'},{'name':'connection','on_enter':'go'}])

Error:
Argument of type "list[dict[str, str]]" cannot be assigned to parameter "__iterable" of type "Iterable[list[str]]" in function "init"

Is the orderedDict not allowed inside init method. How can I deal with that?

Thanks in advance.

Originally posted by @AnirudhSuri in #602

Hello @msdian-hub,

as you initially guessed, this is more suitable for a discussion. I will answer your question there.