Next / Previous / Contents / TCC Help System / NM Tech homepage

13.14. frozenset(): Create a frozen set

This function is used to create a new frozenset value: an immutable set. General forms:

frozenset()
frozenset(S)

The first form creates an empty frozenset. To convert an existing sequence value S to a frozenset, use the second form.

>>> frozenset()
frozenset([])
>>> frozenset('aeiou')
frozenset(['a', 'i', 'e', 'u', 'o'])
>>> frozenset([0, 0, 0, 44, 0, 44, 18])
frozenset([0, 18, 44])

For more information, see Section 8, “Types set and frozenset: Set types”.