I wish to use a Python dictionary to keep track of some running tasks. Each of these tasks has a number of attributes which makes it unique, so I\'d like to use a function of th
Use a tuple in place of the list. Tuples are immutable and can be used as dictionary keys:
d[(attrib_a, attrib_b)] = t
The parentheses can be omitted:
d[attrib_a, attrib_b] = t
However, some people seem to dislike this syntax.
Use a tuple
d[(attrib_a, attrib_b)] = t
That should work fine