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

20.17. frozenset(): Create a frozen set

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

frozenset(S)

This function converts an existing iterable S to a frozenset. The argument is optional; if omitted, you get a frozen empty set.

>>> 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 15, “Types set and frozenset: Set types”.