更新时间:2023-02-17 12:54:44
使用元组代替列表。元组是不可变的,可以用作字典键:
Use a tuple in place of the list. Tuples are immutable and can be used as dictionary keys:
d[(attrib_a, attrib_b)] = t
括号可以省略:
d[attrib_a, attrib_b] = t
然而,有些人似乎不喜欢这种语法。
However, some people seem to dislike this syntax.