上QQ阅读APP看书,第一时间看更新
frozenset
frozenset lives in Python itself, so there is no need to import anything. They are 100% similar to ordinal sets, except that they are immutable. Just like tuples, you cannot change them, and they can be used as dictionary keys, among other similarities:
>>> frozenset('Hello')
frozenset({'e', 'H', 'l', 'o'})