I got a problem: I want to save lists in a dictionary like that:
EventFields: dict = {[0, 1]: 'specialField'}
Why does this not match? And what's the solution?
Thanks
I got a problem: I want to save lists in a dictionary like that:
EventFields: dict = {[0, 1]: 'specialField'}
Why does this not match? And what's the solution?
Thanks
Lists aren't hashable, since you can mutate a list (e.g. by doing something like list[0] = 1
).
You would want to cast the list to a tuple:
dict = {(0, 1): 'specialField'}