元組是元素明確的可洗和等同的

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

因此,元組可以放在 set 中,也可以作為 dict 中的一個關鍵字,只有每個元素都可以。

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