元组是元素明确的可洗和等同的

hash( (1, 2) )  # ok
hash( ([], {"hello"})  # not ok, since lists and sets are not hashabe

因此,元组可以放在 set 中,也可以作为 dict 中的一个关键字,只有每个元素都可以。

{ (1, 2) } #  ok
{ ([], {"hello"}) ) # not ok